From: Gergő Tisza Date: Fri, 30 Oct 2015 00:13:37 +0000 (-0700) Subject: Fix AbortLogin hook return value check X-Git-Tag: 1.31.0-rc.0~9169^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=5669bf329a5f7449d64c39ed17f5d17a16d457da Fix AbortLogin hook return value check Bug: T117027 Change-Id: Ia0a222058306bd7e3d1d090dca9976dee54dcc6d --- diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php index 6c6ba3b39a..c569b0da58 100644 --- a/includes/specials/SpecialUserlogin.php +++ b/includes/specials/SpecialUserlogin.php @@ -784,7 +784,7 @@ class LoginForm extends SpecialPage { // Give general extensions, such as a captcha, a chance to abort logins $abort = self::ABORTED; if ( !Hooks::run( 'AbortLogin', array( $u, $this->mPassword, &$abort, &$msg ) ) ) { - if ( !in_array( $abort, self::$statusCodes, true ) ) { + if ( !in_array( $abort, array_keys( self::$statusCodes ), true ) ) { throw new Exception( 'Invalid status code returned from AbortLogin hook: ' . $abort ); } $this->mAbortLoginErrorMsg = $msg;