Invalid argument supplied for foreach() in FormatMetadata.php on line 1566
authorReedy <reedy@wikimedia.org>
Mon, 4 Nov 2013 23:04:01 +0000 (23:04 +0000)
committerBryanDavis <bdavis@wikimedia.org>
Tue, 5 Nov 2013 15:05:12 +0000 (15:05 +0000)
Bug: 56585
Change-Id: I5f65333cc94b66fd80fcf5abcfad7e10e4669310

includes/media/FormatMetadata.php

index b34ad65..91c4c9a 100755 (executable)
@@ -1563,11 +1563,13 @@ class FormatMetadata extends ContextSource {
 
                $common = $file->getCommonMetaArray();
 
-               foreach ( $common as $key => $value ) {
-                       $fileMetadata[$key] = array(
-                               'value' => $value,
-                               'source' => 'file-metadata',
-                       );
+               if ( $common !== false ) {
+                       foreach ( $common as $key => $value ) {
+                               $fileMetadata[$key] = array(
+                                       'value' => $value,
+                                       'source' => 'file-metadata',
+                               );
+                       }
                }
 
                wfProfileOut( __METHOD__ );