From dd5e44ea63cd0b76adcd2c5b46ff94d93e6181ee Mon Sep 17 00:00:00 2001 From: =?utf8?q?Robert=20Stojni=C4=87?= Date: Sun, 22 Oct 2006 01:24:39 +0000 Subject: [PATCH] Fix bug #7605. For logged-in users use the selected variant(if any) insted the one from user settings. --- includes/StubObject.php | 9 +++++++++ 1 file changed, 9 insertions(+) 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; -- 2.20.1