Fix sequence issue with /signup URL form
authorMatthew Flaschen <mflaschen@wikimedia.org>
Fri, 12 Apr 2013 05:10:53 +0000 (01:10 -0400)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 12 Apr 2013 19:26:17 +0000 (19:26 +0000)
/signup subpage affects form display and title (just like ?type=signup),
so check for it earlier in execute().
Also rename execute()'s $par parameter to $subPage to match SubPage.php.

Change-Id: Ida615a1039bfa1d8328f5fda24c4e3da66b9d162

includes/specials/SpecialUserlogin.php

index a86c356..41c63b6 100644 (file)
@@ -141,8 +141,6 @@ class LoginForm extends SpecialPage {
                        $this->mReturnTo = '';
                        $this->mReturnToQuery = '';
                }
-
-               $this->mShowVForm = $this->shouldShowVForm();
        }
 
        function getDescription() {
@@ -160,17 +158,24 @@ class LoginForm extends SpecialPage {
                }
        }
 
-       public function execute( $par ) {
+       /*
+        * @param $subPage string|null
+        */
+       public function execute( $subPage ) {
                if ( session_id() == '' ) {
                        wfSetupSession();
                }
 
                $this->load();
-               $this->setHeaders();
 
-               if ( $par == 'signup' ) { # Check for [[Special:Userlogin/signup]]
+               // Check for [[Special:Userlogin/signup]. This affects form display and
+               // page title.
+               if ( $subPage == 'signup' ) {
                        $this->mType = 'signup';
                }
+               $this->mShowVForm = $this->shouldShowVForm();
+
+               $this->setHeaders();
 
                // If logging in and not on HTTPS, either redirect to it or offer a link.
                global $wgSecureLogin;