From d233ccbcc71e7f0f0f060ca0d2b1c51004b9fdda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20H=C3=B6=C3=9Fl?= Date: Sun, 12 Aug 2012 08:27:05 +0000 Subject: [PATCH] An additional check to prevent PHP-notices that might corrupt the image data --- privacy_image_cache/privacy_image_cache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/privacy_image_cache/privacy_image_cache.php b/privacy_image_cache/privacy_image_cache.php index 8c68ef9a..f4ada61e 100644 --- a/privacy_image_cache/privacy_image_cache.php +++ b/privacy_image_cache/privacy_image_cache.php @@ -137,7 +137,7 @@ function privacy_image_cache_init() { } // Writing in cachefile - if (isset($cachefile) && ($cachefile != '') and (exif_imagetype($cachefile) > 0)) + if (isset($cachefile) && ($cachefile != '') and (file_exists($cachefile)) and (exif_imagetype($cachefile) > 0)) file_put_contents($cachefile, $img_str); header("Content-type: $mime");