From e96e7ba96cb1d192999545a7ae69ac46b02581a5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Mon, 24 Dec 2007 13:14:25 +0000 Subject: [PATCH] * Reverting r28802 until I can figure what is going on --- RELEASE-NOTES | 1 - includes/StubObject.php | 17 +++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 96581c7c43..9fe10acb74 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -267,7 +267,6 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 12371) Handle more namespace case variants in namespaceDupes.php * (bug 12380) Bot-friendly EditPage::spamPage * (bug 8066) Spaces can't be entered in special page aliases -* (bug 10837) Interface "variant" overruling "language" preference == Parser changes in 1.12 == diff --git a/includes/StubObject.php b/includes/StubObject.php index 16c5302ca0..876cf50ec5 100644 --- a/includes/StubObject.php +++ b/includes/StubObject.php @@ -91,16 +91,13 @@ class StubUserLang extends StubObject { global $wgContLanguageCode, $wgRequest, $wgUser, $wgContLang; $code = $wgRequest->getVal('uselang', $wgUser->getOption('language') ); - // IF the content language has variants... - if ( $wgContLang->hasVariants() ) { - // AND IF the current interface language is the same as content language - if ( $code === $wgContLanguageCode ) { - // THEN use preferred variant as interface language. - // Happens when anonymous users or logged in users with default language - // setting selects a variant conversion. - $code = $wgContLang->getPreferredVariant(); - } - } + // if variant is explicitely selected, use it instead the one from wgUser + // see bug #7605 + if($wgContLang->hasVariants()){ + $variant = $wgContLang->getPreferredVariant(); + if($variant != $wgContLanguageCode) + $code = $variant; + } # Validate $code if( empty( $code ) || !preg_match( '/^[a-z-]+$/', $code ) ) { -- 2.20.1