Fixed incorrect parameter passed to LoginForm::userBlockedMessage()
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Sun, 14 Apr 2013 20:43:58 +0000 (22:43 +0200)
committerAlexandre Emsenhuber <ialex.wiki@gmail.com>
Sun, 14 Apr 2013 20:43:58 +0000 (22:43 +0200)
The error is Catchable fatal error: Argument 1 passed to
LoginForm::userBlockedMessage() must be an instance of Block, null given.

The problem is that User::$mBlock is not always the correct block, when
checking that a blocked logged-in user can create an account.

bug: 47138
Change-Id: I43f35cfa342737f05a08a693a86949c14348321f

RELEASE-NOTES-1.22
includes/specials/SpecialUserlogin.php

index c0d4951..b360979 100644 (file)
@@ -29,7 +29,8 @@ production.
 === Bug fixes in 1.22 ===
 * Disable Special:PasswordReset when $wgEnableEmail. Previously one could still
   navigate to the page by entering the URL directly.
-
+* (bug 47138) Fixed a fatal error when a blocked user tries to automatically
+  create an account on login due external authentication in some circumstances.
 
 === API changes in 1.22 ===
 * (bug 46626) xmldoublequote parameter was removed. Because of a bug, the
index 41c63b6..e0ddc96 100644 (file)
@@ -819,7 +819,7 @@ class LoginForm extends SpecialPage {
                                $this->resetLoginForm( $this->msg( 'resetpass_announce' )->text() );
                                break;
                        case self::CREATE_BLOCKED:
-                               $this->userBlockedMessage( $this->getUser()->mBlock );
+                               $this->userBlockedMessage( $this->getUser()->isBlockedFromCreateAccount() );
                                break;
                        case self::THROTTLED:
                                $this->mainLoginForm( $this->msg( 'login-throttled' )->text() );