r60523 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60522‎ | r60523 | r60524 >
Date:17:14, 31 December 2009
Author:philip
Status:deferred (Comments)
Tags:
Comment:
bug 21974, don't return $this->mPreferredVariant if $fromUser = false
Modified paths:
  • /trunk/phase3/languages/LanguageConverter.php (modified) (history)

Diff [purge]

Index: trunk/phase3/languages/LanguageConverter.php
@@ -133,7 +133,8 @@
134134 function getPreferredVariant( $fromUser = true, $fromHeader = false ) {
135135 global $wgUser, $wgRequest, $wgVariantArticlePath, $wgDefaultLanguageVariant, $wgOut;
136136
137 - if($this->mPreferredVariant)
 137+ // bug 21974, don't return $this->mPreferredVariant if $fromUser = false
 138+ if( $fromUser && $this->mPreferredVariant )
138139 return $this->mPreferredVariant;
139140
140141 // figure out user lang without constructing wgLang to avoid infinite recursion
@@ -175,7 +176,7 @@
176177 }
177178
178179 // 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 )){
180181 $this->mPreferredVariant = $wgDefaultLanguageVariant;
181182 return $this->mPreferredVariant;
182183 }
@@ -230,10 +231,8 @@
231232 }
232233 }
233234 }
234 - return $this->mMainLanguageCode;
235235 }
236 - else return $this->mPreferredVariant;
237 -
 236+ return $this->mMainLanguageCode;
238237 }
239238
240239 /**

Comments

#Comment by Tim Starling (talk | contribs)   03:07, 15 January 2010

Marking deferred since it was rewritten in r60709.

Status & tagging log