Index: trunk/phase3/languages/LanguageConverter.php |
— | — | @@ -133,7 +133,8 @@ |
134 | 134 | function getPreferredVariant( $fromUser = true, $fromHeader = false ) { |
135 | 135 | global $wgUser, $wgRequest, $wgVariantArticlePath, $wgDefaultLanguageVariant, $wgOut; |
136 | 136 | |
137 | | - if($this->mPreferredVariant) |
| 137 | + // bug 21974, don't return $this->mPreferredVariant if $fromUser = false |
| 138 | + if( $fromUser && $this->mPreferredVariant ) |
138 | 139 | return $this->mPreferredVariant; |
139 | 140 | |
140 | 141 | // figure out user lang without constructing wgLang to avoid infinite recursion |
— | — | @@ -175,7 +176,7 @@ |
176 | 177 | } |
177 | 178 | |
178 | 179 | // see if default variant is globaly set |
179 | | - if($wgDefaultLanguageVariant != false && in_array( $wgDefaultLanguageVariant, $this->mVariants )){ |
| 180 | + if($wgDefaultLanguageVariant != false && in_array( $wgDefaultLanguageVariant, $this->mVariants )){ |
180 | 181 | $this->mPreferredVariant = $wgDefaultLanguageVariant; |
181 | 182 | return $this->mPreferredVariant; |
182 | 183 | } |
— | — | @@ -230,10 +231,8 @@ |
231 | 232 | } |
232 | 233 | } |
233 | 234 | } |
234 | | - return $this->mMainLanguageCode; |
235 | 235 | } |
236 | | - else return $this->mPreferredVariant; |
237 | | - |
| 236 | + return $this->mMainLanguageCode; |
238 | 237 | } |
239 | 238 | |
240 | 239 | /** |