r65150 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65149‎ | r65150 | r65151 >
Date:01:37, 17 April 2010
Author:vyznev
Status:resolved (Comments)
Tags:
Comment:
override isMetadataValid() so that we don't regenerate GIF metadata every time
Modified paths:
  • /trunk/phase3/includes/media/GIF.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/media/GIF.php
@@ -44,6 +44,11 @@
4545 return 'parsed-gif';
4646 }
4747
 48+ function isMetadataValid( $image, $metadata ) {
 49+ $data = @unserialize( $metadata );
 50+ return (boolean) $data;
 51+ }
 52+
4853 function getLongDesc( $image ) {
4954 global $wgUser, $wgLang;
5055 $sk = $wgUser->getSkin();

Comments

#Comment by 😂 (talk | contribs)   08:53, 17 April 2010

Please do not use the @ operator. If you really want to suppress warnings, put wfSuppressWarnings() and wfRestoreWarnings() on either side of it.

#Comment by Ilmari Karonen (talk | contribs)   10:31, 17 April 2010

Presumably the parent class should then be fixed too, since that's where I copied it from?

#Comment by 😂 (talk | contribs)   10:42, 17 April 2010

Yes it should then. I didn't look at that file too, I was just reviewing this patch.

#Comment by 😂 (talk | contribs)   10:15, 9 June 2010

Forgot about this, resolved in r67697.

Status & tagging log