* Adding wfSuppressWarnings() before the Exif validation, some of the type
authorÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Sun, 8 May 2005 07:32:04 +0000 (07:32 +0000)
committerÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Sun, 8 May 2005 07:32:04 +0000 (07:32 +0000)
  checks in Exif::validate will spew warnings on invalid data.

includes/Image.php

index d1835a9..5817272 100644 (file)
@@ -1140,11 +1140,14 @@ class Image
                $exif = exif_read_data( $this->imagePath );
 
                $obj = new Exif;
-               $valid = $obj->mValidExif;
+               // Some of the type checks in validate will spew warnings on invalid data
+               wfSuppressWarnings();
                foreach($exif as $k => $v) {
-                       if ( !in_array($k, $valid) || !$obj->validate($k, $v) )
+                       if ( !in_array($k, $obj->mValidExif) || !$obj->validate($k, $v) )
                                unset($exif[$k]);
                }
+               wfRestoreWarnings();
+               
                return $exif;
        }