diff --git a/library/HTMLPurifier/URIScheme/data.php b/library/HTMLPurifier/URIScheme/data.php
index 02e540cb..2648de4a 100644
--- a/library/HTMLPurifier/URIScheme/data.php
+++ b/library/HTMLPurifier/URIScheme/data.php
@@ -93,7 +93,9 @@ public function doValidate(&$uri, $config, $context)
}
file_put_contents($file, $raw_data);
if (function_exists('exif_imagetype')) {
+ set_error_handler(array($this, 'muteErrorHandler'));
$image_code = exif_imagetype($file);
+ restore_error_handler();
unlink($file);
} elseif (function_exists('getimagesize')) {
set_error_handler(array($this, 'muteErrorHandler'));