Merge "Fix AbortLogin hook return value check"

This commit is contained in:
jenkins-bot 2015-10-30 00:30:30 +00:00 committed by Gerrit Code Review
commit f1f680b180

View file

@ -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;