From 2364bc8edb906147156d23fff0c70b58e7589b36 Mon Sep 17 00:00:00 2001 From: Ilmari Karonen Date: Sun, 10 May 2009 20:33:55 +0000 Subject: [PATCH] fix regression from r49677 by refusing to format old-style metadata even if a foreign repo hands us some --- includes/media/Bitmap.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/includes/media/Bitmap.php b/includes/media/Bitmap.php index 80d5ff8f44..98453c2ef5 100644 --- a/includes/media/Bitmap.php +++ b/includes/media/Bitmap.php @@ -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 ); -- 2.20.1