Index: trunk/extensions/LocalisationUpdate/LocalisationUpdate.class.php |
— | — | @@ -326,7 +326,8 @@ |
327 | 327 | $basefilecontents = self::getFileContents( $basefile ); |
328 | 328 | |
329 | 329 | if ( $basefilecontents === false || $basefilecontents === '' ) { |
330 | | - return array(); // Failed |
| 330 | + self::myLog( "Failed to read $basefile" ); |
| 331 | + return array(); |
331 | 332 | } |
332 | 333 | |
333 | 334 | // Only get the part we need. |
— | — | @@ -346,11 +347,17 @@ |
347 | 348 | |
348 | 349 | // Get the array with messages. |
349 | 350 | $base_messages = self::parsePHP( $basefilecontents, 'base_messages' ); |
| 351 | + if ( !is_array( $base_messages ) ) { |
| 352 | + // Broken file? Report and bail |
| 353 | + self::myLog( "Failed to parse $basefile" ); |
| 354 | + return array(); |
| 355 | + } |
350 | 356 | |
351 | 357 | $comparefilecontents = self::getFileContents( $comparefile ); |
352 | 358 | |
353 | 359 | if ( $comparefilecontents === false || $comparefilecontents === '' ) { |
354 | | - return array(); // Failed |
| 360 | + self::myLog( "Failed to read $comparefile" ); |
| 361 | + return array(); |
355 | 362 | } |
356 | 363 | |
357 | 364 | // Only get the stuff we need. |
— | — | @@ -370,6 +377,11 @@ |
371 | 378 | |
372 | 379 | // Get the array. |
373 | 380 | $compare_messages = self::parsePHP( $comparefilecontents, 'compare_messages' ); |
| 381 | + if ( !is_array( $compare_messages ) ) { |
| 382 | + // Broken file? Report and bail |
| 383 | + self::myLog( "Failed to parse $comparefile" ); |
| 384 | + return array(); |
| 385 | + } |
374 | 386 | |
375 | 387 | // If the localfile and the remote file are the same, skip them! |
376 | 388 | if ( $basehash == $comparehash && !$alwaysGetResult ) { |