if ( ++$recursionLevel > 2 ) {
throw new MWException( "Unstub loop detected on call of \${$this->mGlobal}->$name from $caller\n" );
}
- wfDebug( "Unstubbing \${$this->mGlobal} on call of \${$this->mGlobal}->$name from $caller\n" );
+ wfDebug( "Unstubbing \${$this->mGlobal} on call of \${$this->mGlobal}::$name from $caller\n" );
$GLOBALS[$this->mGlobal] = $this->_newObject();
--$recursionLevel;
wfProfileOut( $fname );
// 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;
}
# Validate $code
- if( empty( $code ) || !preg_match( '/^[a-z-]+$/', $code ) ) {
+ if( empty( $code ) || !preg_match( '/^[a-z-]+$/', $code ) || ( $code === 'qqq' ) ) {
wfDebug( "Invalid user language code\n" );
$code = $wgContLanguageCode;
}