Merge "Perform a permission check on the title when changing the page language"
[lhc/web/wiklou.git] / includes / filerepo / file / File.php
index 0ad0527..9aa2b18 100644 (file)
@@ -2165,13 +2165,15 @@ abstract class File implements IDBAccessObject {
                if ( $handler ) {
                        $metadata = $this->getMetadata();
 
-                       if ( $metadata ) {
-                               if ( is_string( $metadata ) ) {
-                                       $metadata = MediaWiki\quietCall( 'unserialize', $metadata );
-                               }
+                       if ( is_string( $metadata ) ) {
+                               $metadata = MediaWiki\quietCall( 'unserialize', $metadata );
+                       }
 
-                               return $handler->getContentHeaders( $metadata, $this->getWidth(), $this->getHeight() );
+                       if ( !is_array( $metadata ) ) {
+                               $metadata = [];
                        }
+
+                       return $handler->getContentHeaders( $metadata );
                }
 
                return [];