r67697 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67696‎ | r67697 | r67698 >
Date:10:15, 9 June 2010
Author:demon
Status:ok
Tags:
Comment:
Don't use @, use wfSuppress/RestoreWarnings
Modified paths:
  • /trunk/phase3/includes/media/Bitmap.php (modified) (history)
  • /trunk/phase3/includes/media/GIF.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/media/Bitmap.php
@@ -372,7 +372,9 @@
373373 # Special value indicating that there is no EXIF data in the file
374374 return true;
375375 }
376 - $exif = @unserialize( $metadata );
 376+ wfSuppressWarnings();
 377+ $exif = unserialize( $metadata );
 378+ wfRestoreWarnings();
377379 if ( !isset( $exif['MEDIAWIKI_EXIF_VERSION'] ) ||
378380 $exif['MEDIAWIKI_EXIF_VERSION'] != Exif::version() )
379381 {
Index: trunk/phase3/includes/media/GIF.php
@@ -54,16 +54,20 @@
5555 }
5656
5757 function isMetadataValid( $image, $metadata ) {
58 - $data = @unserialize( $metadata );
 58+ wfSuppressWarnings();
 59+ $data = unserialize( $metadata );
 60+ wfRestoreWarnings();
5961 return (boolean) $data;
6062 }
6163
6264 function getLongDesc( $image ) {
6365 global $wgUser, $wgLang;
6466 $sk = $wgUser->getSkin();
 67+
 68+ wfSuppressWarnings();
 69+ $metadata = unserialize($image->getMetadata());
 70+ wfRestoreWarnings();
6571
66 - $metadata = @unserialize($image->getMetadata());
67 -
6872 if (!$metadata) return parent::getLongDesc( $image );
6973
7074 $info = array();

Status & tagging log