r36793 - Code Review

From MediaWiki.org

Jump to: navigation, search
Repository:MediaWiki
Revision:r36792 | r36793 (on ViewVC) | r36794 >
Date:22:46, 29 June 2008
Author:daniel
Status:ok
Tags:
Comment:use wfSetupSessision as soon as captcha is shown
Modified paths:

Diff [purge]

Index: trunk/extensions/ContactPage/SpecialContact.php
===================================================================
--- trunk/extensions/ContactPage/SpecialContact.php	(revision 36792)
+++ trunk/extensions/ContactPage/SpecialContact.php	(revision 36793)
@@ -60,8 +60,6 @@
 			wfDebug( "$fname: success.\n" );
 			$f->showSuccess( );
 		} else if ( "submit" == $action && $wgRequest->wasPosted() ) {#
-			wfSetupSession(); #NOTE: make sure we have a session. May be required for captchas to work.
-
 			$token = $wgRequest->getVal( 'wpEditToken' );
 
 			if( $wgUser->isAnon() ) {
@@ -202,6 +200,8 @@
 		if ( !$wgCaptcha ) return ""; //no captcha installed
 		if ( !@$wgCaptchaTriggers['contactpage'] ) return ""; //don't trigger on contact form
 
+		wfSetupSession(); #NOTE: make sure we have a session. May be required for captchas to work.
+
 		return "<div class='captcha'>" .
 		$wgCaptcha->getForm() .
 		wfMsgWikiHtml( 'contactpage-captcha' ) .
Views
Toolbox