Fix handling of already logged-in user in Special:Userlogin
authorGergő Tisza <tgr.huwiki@gmail.com>
Wed, 18 Jul 2018 22:49:50 +0000 (00:49 +0200)
committerGergő Tisza <tgr.huwiki@gmail.com>
Wed, 18 Jul 2018 22:49:50 +0000 (00:49 +0200)
Due to a forgotten return clause, the full request handling
is executed after calling successfulAction() when the user
reloads the login page while logged in. With a typical setup
case this is masked by the fact that successfulAction() does
a redirect (although it probably still impacts performance),
for less common configurations this might result in the login
form rendered below a success message, or in calling extension
hooks which should not be called.

Bug: T185702
Change-Id: If19220c4cf17b08f7e03ca0d06381067f26dda1a

includes/specialpage/LoginSignupSpecialPage.php

index d5c889a..e94f3db 100644 (file)
@@ -265,6 +265,7 @@ abstract class LoginSignupSpecialPage extends AuthManagerSpecialPage {
                         $this->getUser()->isLoggedIn()
                ) {
                        $this->successfulAction();
+                       return;
                }
 
                // If logging in and not on HTTPS, either redirect to it or offer a link.