Clean up ipb_deleted query slightly
[lhc/web/wiklou.git] / includes / StubObject.php
index 07db880..f1847a3 100644 (file)
@@ -95,7 +95,7 @@ class StubObject {
                        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 );
@@ -147,14 +147,14 @@ 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;
                }
 
                # 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;
                }