job-queue insert should no longer fail for highly used templates (bug 5527)
[lhc/web/wiklou.git] / includes / StubObject.php
index 9282ede..ec52e7f 100644 (file)
@@ -147,7 +147,7 @@ class StubUserLang extends StubObject {
 
                // if variant is explicitely selected, use it instead the one from wgUser
                // see bug #7605
-               if( $wgContLang->hasVariants() ){
+               if( $wgContLang->hasVariants() && in_array($code, $wgContLang->getVariants()) ){
                        $variant = $wgContLang->getPreferredVariant();
                        if( $variant != $wgContLanguageCode )
                                $code = $variant;
@@ -190,7 +190,6 @@ class StubUser extends StubObject {
                        $user = new User;
                } else {
                        $user = User::newFromSession();
-                       wfRunHooks( 'AutoAuthenticate', array( &$user ) );
                }
                return $user;
        }