From 222b01f5169f1c7e69762e0e8904c24f78f71882 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 28 Jul 2010 11:52:48 +0200 Subject: update to MediaWiki 1.16.0 --- includes/StubObject.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'includes/StubObject.php') diff --git a/includes/StubObject.php b/includes/StubObject.php index f1847a39..c8731fff 100644 --- a/includes/StubObject.php +++ b/includes/StubObject.php @@ -88,6 +88,10 @@ class StubObject { */ function _unstub( $name = '_unstub', $level = 2 ) { static $recursionLevel = 0; + + if ( !($GLOBALS[$this->mGlobal] instanceof StubObject) ) + return $GLOBALS[$this->mGlobal]; // already unstubbed. + if ( get_class( $GLOBALS[$this->mGlobal] ) != $this->mClass ) { $fname = __METHOD__.'-'.$this->mGlobal; wfProfileIn( $fname ); @@ -96,7 +100,7 @@ class StubObject { 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" ); - $GLOBALS[$this->mGlobal] = $this->_newObject(); + $obj = $GLOBALS[$this->mGlobal] = $this->_newObject(); --$recursionLevel; wfProfileOut( $fname ); } @@ -144,14 +148,8 @@ class StubUserLang extends StubObject { function _newObject() { global $wgContLanguageCode, $wgRequest, $wgUser, $wgContLang; $code = $wgRequest->getVal( 'uselang', $wgUser->getOption( 'language' ) ); - - // if variant is explicitely selected, use it instead the one from wgUser - // see bug #7605 - if( $wgContLang->hasVariants() && in_array($code, $wgContLang->getVariants()) ){ - $variant = $wgContLang->getPreferredVariant(); - if( $variant != $wgContLanguageCode ) - $code = $variant; - } + // BCP 47 - letter case MUST NOT carry meaning + $code = strtolower( $code ); # Validate $code if( empty( $code ) || !preg_match( '/^[a-z-]+$/', $code ) || ( $code === 'qqq' ) ) { -- cgit v1.2.3-54-g00ecf