return self::METADATA_GOOD;
}
- wfSuppressWarnings();
+ MediaWiki\suppressWarnings();
$data = unserialize( $metadata );
- wfRestoreWarnings();
+ MediaWiki\restoreWarnings();
if ( !$data || !is_array( $data ) ) {
wfDebug( __METHOD__ . " invalid WebP metadata\n" );
if ( $file === null ) {
$metadata = self::getMetadata( $file, $path );
}
- if ( $metadata === false ) {
+ if ( $metadata === false && $file instanceof File ) {
$metadata = $file->getMetadata();
}
- wfSuppressWarnings();
+ MediaWiki\suppressWarnings();
$metadata = unserialize( $metadata );
- wfRestoreWarnings();
+ MediaWiki\restoreWarnings();
if ( $metadata == false ) {
return false;