From: Robert Stojnić Date: Sun, 22 Oct 2006 01:24:39 +0000 (+0000) Subject: Fix bug #7605. For logged-in users use the selected variant(if any) insted the one... X-Git-Tag: 1.31.0-rc.0~55408 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=dd5e44ea63cd0b76adcd2c5b46ff94d93e6181ee;p=lhc%2Fweb%2Fwiklou.git Fix bug #7605. For logged-in users use the selected variant(if any) insted the one from user settings. --- diff --git a/includes/StubObject.php b/includes/StubObject.php index 87316700df..4068c31c3b 100644 --- a/includes/StubObject.php +++ b/includes/StubObject.php @@ -92,6 +92,15 @@ class StubUserLang extends StubObject { $code = $wgRequest->getVal('uselang', ''); if ($code == '') $code = $wgUser->getOption('language'); + + // if variant is explicitely selected, use it instead the one from wgUser + // see bug #7605 + if($wgContLang->hasVariants()){ + $variant = $wgContLang->getPreferredVariant(false); + if($variant != $wgContLanguageCode) + $code = $variant; + } + # Validate $code if( empty( $code ) || !preg_match( '/^[a-z]+(-[a-z]+)?$/', $code ) ) { $code = $wgContLanguageCode;