Merge "Revert "Use display name in category page subheadings if provided""
[lhc/web/wiklou.git] / includes / specialpage / LoginSignupSpecialPage.php
index 984e32b..1e03774 100644 (file)
@@ -156,7 +156,7 @@ abstract class LoginSignupSpecialPage extends AuthManagerSpecialPage {
                        [
                                'returnto' => $this->mReturnTo,
                                'returntoquery' => $this->mReturnToQuery,
-                               'uselang' => $this->mLanguage,
+                               'uselang' => $this->mLanguage ?: null,
                                'fromhttp' => $wgSecureLogin && $this->mFromHTTP ? '1' : null,
                        ]
                );
@@ -619,7 +619,7 @@ abstract class LoginSignupSpecialPage extends AuthManagerSpecialPage {
                $form = HTMLForm::factory( 'vform', $formDescriptor, $context );
 
                $form->addHiddenField( 'authAction', $this->authAction );
-               if ( $wgLoginLanguageSelector ) {
+               if ( $wgLoginLanguageSelector && $this->mLanguage ) {
                        $form->addHiddenField( 'uselang', $this->mLanguage );
                }
                $form->addHiddenField( 'force', $this->securityLevel );
@@ -763,14 +763,21 @@ abstract class LoginSignupSpecialPage extends AuthManagerSpecialPage {
                $wgAuth->modifyUITemplate( $template, $action );
 
                $oldTemplate = $template;
-               $hookName = $this->isSignup() ? 'UserCreateForm' : 'UserLoginForm';
-               Hooks::run( $hookName, [ &$template ] );
-               if ( $oldTemplate !== $template ) {
-                       wfDeprecated( "reference in $hookName hook", '1.27' );
+
+               // Both Hooks::run are explicit here to make findHooks.php happy
+               if ( $this->isSignup() ) {
+                       Hooks::run( 'UserCreateForm', [ &$template ] );
+                       if ( $oldTemplate !== $template ) {
+                               wfDeprecated( "reference in UserCreateForm hook", '1.27' );
+                       }
+               } else {
+                       Hooks::run( 'UserLoginForm', [ &$template ] );
+                       if ( $oldTemplate !== $template ) {
+                               wfDeprecated( "reference in UserLoginForm hook", '1.27' );
+                       }
                }
 
                return $template;
-
        }
 
        public function onAuthChangeFormFields(