Do not call filesize(null), this function expects a string.

filesize(null) yields an int on HHVM and thus exif_imagetype(null) is called.
This commit is contained in:
Andreas Fischer 2014-12-18 20:42:35 +01:00
parent 10a0fc2856
commit 3ebb69944b
1 changed files with 1 additions and 1 deletions

View File

@ -37,7 +37,7 @@ class OC_Image {
*/ */
static public function getMimeTypeForFile($filePath) { static public function getMimeTypeForFile($filePath) {
// exif_imagetype throws "read error!" if file is less than 12 byte // 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); $imageType = exif_imagetype($filePath);
} else { } else {
$imageType = false; $imageType = false;