]> git.mxchange.org Git - friendica-addons.git/commitdiff
An additional check to prevent PHP-notices that might corrupt the image data
authorTobias Hößl <tobias@hoessl.eu>
Sun, 12 Aug 2012 08:27:05 +0000 (08:27 +0000)
committerTobias Hößl <tobias@hoessl.eu>
Sun, 12 Aug 2012 08:27:05 +0000 (08:27 +0000)
privacy_image_cache/privacy_image_cache.php

index 8c68ef9a4bf555a3b7f2d92151c8cdfa363c7594..f4ada61e1db4ca2684530fd5fd4269d74e73e17a 100644 (file)
@@ -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");