From 42c8f3f21f157a9f7ea3e3f875eae6d63fd094f1 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sun, 14 Apr 2013 22:43:58 +0200 Subject: [PATCH] Fixed incorrect parameter passed to LoginForm::userBlockedMessage() 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 | 3 ++- includes/specials/SpecialUserlogin.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES-1.22 b/RELEASE-NOTES-1.22 index c0d4951a7a..b360979827 100644 --- a/RELEASE-NOTES-1.22 +++ b/RELEASE-NOTES-1.22 @@ -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 diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php index 41c63b6c31..e0ddc962ce 100644 --- a/includes/specials/SpecialUserlogin.php +++ b/includes/specials/SpecialUserlogin.php @@ -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() ); -- 2.20.1