From 5cfa89d97b8bb2a9d41eaf9af7a7c71749799b84 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sun, 8 May 2005 07:32:04 +0000 Subject: [PATCH] * Adding wfSuppressWarnings() before the Exif validation, some of the type checks in Exif::validate will spew warnings on invalid data. --- includes/Image.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/includes/Image.php b/includes/Image.php index d1835a9bab..581727285f 100644 --- a/includes/Image.php +++ b/includes/Image.php @@ -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; } -- 2.20.1