Don't use @, use wfSuppress/RestoreWarnings
authorChad Horohoe <demon@users.mediawiki.org>
Wed, 9 Jun 2010 10:15:19 +0000 (10:15 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Wed, 9 Jun 2010 10:15:19 +0000 (10:15 +0000)
includes/media/Bitmap.php
includes/media/GIF.php

index d34f125..5a64b32 100644 (file)
@@ -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() )
                {
index 434762f..636ae64 100644 (file)
@@ -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 );