r106200 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106199‎ | r106200 | r106201 >
Date:14:28, 14 December 2011
Author:catrope
Status:ok
Tags:
Comment:
1.18wmf1: MFT r106199
Modified paths:
  • /branches/wmf/1.18wmf1/extensions/LocalisationUpdate (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/LocalisationUpdate/LocalisationUpdate.class.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/extensions/LocalisationUpdate/LocalisationUpdate.class.php
@@ -348,9 +348,14 @@
349349 // Get the array with messages.
350350 $base_messages = self::parsePHP( $basefilecontents, 'base_messages' );
351351 if ( !is_array( $base_messages ) ) {
352 - // Broken file? Report and bail
353 - self::myLog( "Failed to parse $basefile" );
354 - return array();
 352+ if ( strpos( $basefilecontents, "\$base_messages" ) === false ) {
 353+ // No $messages array. This happens for some languages that only have a fallback
 354+ $base_messages = array();
 355+ } else {
 356+ // Broken file? Report and bail
 357+ self::myLog( "Failed to parse $basefile" );
 358+ return array();
 359+ }
355360 }
356361
357362 $comparefilecontents = self::getFileContents( $comparefile );
@@ -379,8 +384,14 @@
380385 $compare_messages = self::parsePHP( $comparefilecontents, 'compare_messages' );
381386 if ( !is_array( $compare_messages ) ) {
382387 // Broken file? Report and bail
383 - self::myLog( "Failed to parse $comparefile" );
384 - return array();
 388+ if ( strpos( $comparefilecontents, "\$compare_messages" ) === false ) {
 389+ // No $messages array. This happens for some languages that only have a fallback
 390+ self::myLog( "Skipping $langcode , no messages array in $comparefile", $verbose );
 391+ $compare_messages = array();
 392+ } else {
 393+ self::myLog( "Failed to parse $comparefile" );
 394+ return array();
 395+ }
385396 }
386397
387398 // If the localfile and the remote file are the same, skip them!
Property changes on: branches/wmf/1.18wmf1/extensions/LocalisationUpdate
___________________________________________________________________
Modified: svn:mergeinfo
388399 Merged /trunk/extensions/LocalisationUpdate:r106199

Follow-up revisions

RevisionCommit summaryAuthorDate
r1062701.18wmf1: Add ArticleFeedbackv5 extension, branched at r106200catrope22:39, 14 December 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r106199Followup r106194: some files deliberately don't have a $messages array becaus...catrope14:27, 14 December 2011

Status & tagging log