Merge "Set Language in SpecialSearchTest.php"
[lhc/web/wiklou.git] / includes / specials / SpecialUserlogin.php
index 6c6ba3b..fec1e3a 100644 (file)
@@ -372,6 +372,7 @@ class LoginForm extends SpecialPage {
                        return;
                }
 
+               /** @var User $u */
                $u = $status->getValue();
 
                // Wipe the initial password and mail a temporary one
@@ -567,7 +568,7 @@ class LoginForm extends SpecialPage {
 
                $cache = ObjectCache::getLocalClusterInstance();
                # Make sure the user does not exist already
-               $lock = $cache->getScopedLock( wfGlobalCacheKey( 'account', md5( $this->mUsername ) ) );
+               $lock = $cache->getScopedLock( $cache->makeGlobalKey( 'account', md5( $this->mUsername ) ) );
                if ( !$lock ) {
                        return Status::newFatal( 'usernameinprogress' );
                } elseif ( $u->idForName( User::READ_LOCKING ) ) {
@@ -784,7 +785,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;