r46525 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46524‎ | r46525 | r46526 >
Date:07:43, 29 January 2009
Author:philip
Status:reverted (Comments)
Tags:
Comment:
mTables' element must not be left blank, to ensure the translate() function could always return a string.
Modified paths:
  • /trunk/phase3/languages/LanguageConverter.php (modified) (history)

Diff [purge]

Index: trunk/phase3/languages/LanguageConverter.php
@@ -296,12 +296,19 @@
297297 if( !in_array($v,$this->mVariants) )continue;
298298 if( $action=="add" ) {
299299 foreach($t as $from=>$to) {
300 - // more efficient than array_merge(), about 2.5 times.
301 - $this->mManualAddTables[$v][$from] = $to;
 300+ // to ensure that $from and $to not be left blank
 301+ // so $this->translate() could always return a string
 302+ if ($from || $to)
 303+ // more efficient than array_merge(), about 2.5 times.
 304+ $this->mManualAddTables[$v][$from] = $to;
302305 }
303306 }
304 - elseif ( $action=="remove" )
305 - $this->mManualRemoveTables[$v] = array_merge($this->mManualRemoveTables[$v], $t);
 307+ elseif ( $action=="remove" ) {
 308+ foreach($t as $from=>$to) {
 309+ if ($from || $to)
 310+ $this->mManualRemoveTables[$v][$from] = $to;
 311+ }
 312+ }
306313 }
307314 }
308315

Follow-up revisions

RevisionCommit summaryAuthorDate
r46526Revert r46523, r46525. Spewing errors. See below. Behaviour observed on http:......siebrand08:59, 29 January 2009

Comments

#Comment by Siebrand (talk | contribs)   09:01, 29 January 2009

Reverted in r46526 because of PHP warning and notices.

#Comment by PhiLiP (talk | contribs)   10:09, 29 January 2009

No need to revert this, fixed in r46528.

#Comment by Siebrand (talk | contribs)   11:28, 29 January 2009

Mind you, I *has* been reverted.

Status & tagging log