Error-handling for GIF getLongDesc
authorAndrew Garrett <werdna@users.mediawiki.org>
Thu, 6 Aug 2009 22:55:44 +0000 (22:55 +0000)
committerAndrew Garrett <werdna@users.mediawiki.org>
Thu, 6 Aug 2009 22:55:44 +0000 (22:55 +0000)
includes/media/GIF.php

index c25b541..ef06aa7 100644 (file)
@@ -36,7 +36,9 @@ class GIFHandler extends BitmapHandler {
                global $wgUser, $wgLang;
                $sk = $wgUser->getSkin();
                
-               $metadata = unserialize($image->getMetadata());
+               $metadata = @unserialize($image->getMetadata());
+               
+               if (!$metadata) return parent::getLongDesc( $image );
                
                $info = array();
                $info[] = $image->getMimeType();