r51011 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51010‎ | r51011 | r51012 >
Date:12:41, 26 May 2009
Author:thedevilonline
Status:deferred
Tags:
Comment:
Fixed bug caused by typo
Modified paths:
  • /trunk/extensions/LocalisationUpdate/LocalisationUpdate.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LocalisationUpdate/LocalisationUpdate.class.php
@@ -256,12 +256,12 @@
257257 $changedStrings = array_diff_assoc( $base_messages, $compare_messages );
258258
259259 // If we want to save the differences
260 - if ( $saveResults === true && !empty($changedStrings)) {
 260+ if ( $saveResults === true && !empty($changedStrings) && is_array($changeStrings)) {
261261 self::myLog( "--Checking languagecode {$langcode}--" );
262262 // The save them
263263 $updates = self::saveChanges( $changedStrings, $forbiddenKeys, $base_messages, $langcode );
264264 self::myLog( "{$updates} messages updated for {$langcode}." );
265 - } elseif($saveResult === true) {
 265+ } elseif($saveResults === true) {
266266 self::myLog( "--{$langcode} hasn't changed--" );
267267 }
268268
@@ -442,12 +442,15 @@
443443 $changedStrings = array_diff_assoc( $messages, $compare_messages[$language] );
444444
445445 // If we want to save the changes
446 - if ( $saveResults ) {
447 - self::myLog( "--Checking languagecode {$language} for extension {$extension}--" );
448 - // Do really save the changes
449 - $updates += self::saveChanges( $changedStrings, $forbiddenKeys, $messages, $language );
 446+ if ( $saveResults === true && !empty($changedStrings) && is_array($changeStrings)) {
 447+ self::myLog( "--Checking languagecode {$langcode}--" );
 448+ // The save them
 449+ $updates = self::saveChanges( $changedStrings, $forbiddenKeys, $base_messages, $langcode );
 450+ self::myLog( "{$updates} messages updated for {$langcode}." );
 451+ } elseif($saveResults === true) {
 452+ self::myLog( "--{$langcode} hasn't changed--" );
450453 }
451 - }
 454+ }
452455
453456 // And log some stuff
454457 self::myLog( "Updated " . $updates . " messages for the '{$extension}' extension" );

Status & tagging log