// 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;
$user = new User;
} else {
$user = User::newFromSession();
- wfRunHooks( 'AutoAuthenticate', array( &$user ) );
}
return $user;
}