From 3ebb69944bd2774d2193dc225bcad447d47296d2 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Thu, 18 Dec 2014 20:42:35 +0100 Subject: Do not call filesize(null), this function expects a string. filesize(null) yields an int on HHVM and thus exif_imagetype(null) is called. --- lib/private/image.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/image.php b/lib/private/image.php index 78cacc84452..07cfb0f72d3 100644 --- a/lib/private/image.php +++ b/lib/private/image.php @@ -37,7 +37,7 @@ class OC_Image { */ static public function getMimeTypeForFile($filePath) { // exif_imagetype throws "read error!" if file is less than 12 byte - if (filesize($filePath) > 11) { + if ($filePath !== null && filesize($filePath) > 11) { $imageType = exif_imagetype($filePath); } else { $imageType = false; -- cgit v1.2.3