From 88fd6d25aba7037e780fd88fd4f684f0f6501de2 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Wed, 9 Jun 2010 10:15:19 +0000 Subject: [PATCH] Don't use @, use wfSuppress/RestoreWarnings --- includes/media/Bitmap.php | 4 +++- includes/media/GIF.php | 10 +++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/includes/media/Bitmap.php b/includes/media/Bitmap.php index d34f125ec2..5a64b32238 100644 --- a/includes/media/Bitmap.php +++ b/includes/media/Bitmap.php @@ -372,7 +372,9 @@ class BitmapHandler extends ImageHandler { # Special value indicating that there is no EXIF data in the file return true; } - $exif = @unserialize( $metadata ); + wfSuppressWarnings(); + $exif = unserialize( $metadata ); + wfRestoreWarnings(); if ( !isset( $exif['MEDIAWIKI_EXIF_VERSION'] ) || $exif['MEDIAWIKI_EXIF_VERSION'] != Exif::version() ) { diff --git a/includes/media/GIF.php b/includes/media/GIF.php index 434762fa1a..636ae6480d 100644 --- a/includes/media/GIF.php +++ b/includes/media/GIF.php @@ -54,15 +54,19 @@ class GIFHandler extends BitmapHandler { } function isMetadataValid( $image, $metadata ) { - $data = @unserialize( $metadata ); + wfSuppressWarnings(); + $data = unserialize( $metadata ); + wfRestoreWarnings(); return (boolean) $data; } function getLongDesc( $image ) { global $wgUser, $wgLang; $sk = $wgUser->getSkin(); - - $metadata = @unserialize($image->getMetadata()); + + wfSuppressWarnings(); + $metadata = unserialize($image->getMetadata()); + wfRestoreWarnings(); if (!$metadata) return parent::getLongDesc( $image ); -- 2.20.1