fix regression from r49677 by refusing to format old-style metadata even if a foreign...
authorIlmari Karonen <vyznev@users.mediawiki.org>
Sun, 10 May 2009 20:33:55 +0000 (20:33 +0000)
committerIlmari Karonen <vyznev@users.mediawiki.org>
Sun, 10 May 2009 20:33:55 +0000 (20:33 +0000)
includes/media/Bitmap.php

index 80d5ff8..98453c2 100644 (file)
@@ -320,6 +320,16 @@ class BitmapHandler extends ImageHandler {
                if ( !$exif ) {
                        return false;
                }
+               if ( !isset( $exif['MEDIAWIKI_EXIF_VERSION'] ) ||
+                    $exif['MEDIAWIKI_EXIF_VERSION'] != Exif::version() )
+               {
+                       // XXX: This should be caught by isMetadataValid(), but
+                       // some non-local repos might call this function without
+                       // checking validity, causing FormatExif to barf, so we
+                       // check it again just to be sure.
+                       wfDebug( __METHOD__.": wrong version\n" );
+                       return false;
+               }
                unset( $exif['MEDIAWIKI_EXIF_VERSION'] );
                $format = new FormatExif( $exif );