From fa6ae81149974d8becc58903d6c63594ed8b5cb4 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 29 Oct 2013 13:36:37 +0100 Subject: [PATCH] Return early if fileinfo is there. --- lib/private/files/type/detection.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/private/files/type/detection.php b/lib/private/files/type/detection.php index e84c63875c..d7cc9ebbf4 100644 --- a/lib/private/files/type/detection.php +++ b/lib/private/files/type/detection.php @@ -74,6 +74,7 @@ class Detection { $info = @strtolower(finfo_file($finfo, $path)); if ($info) { $mimeType = substr($info, 0, strpos($info, ';')); + return empty($mimeType) ? 'application/octet-stream' : $mimeType; } finfo_close($finfo); }