From a04a01d51f6d9dc9ebc346676048e5988ea1beac Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 29 Oct 2013 12:54:30 +0100 Subject: [PATCH] Do not calculate $isWrapped if not needed. --- lib/private/files/type/detection.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/private/files/type/detection.php b/lib/private/files/type/detection.php index 242a81cb5a4..d8a83382822 100644 --- a/lib/private/files/type/detection.php +++ b/lib/private/files/type/detection.php @@ -61,8 +61,6 @@ class Detection { * @return string */ public function detect($path) { - $isWrapped = (strpos($path, '://') !== false) and (substr($path, 0, 7) === 'file://'); - if (@is_dir($path)) { // directories are easy return "httpd/unix-directory"; @@ -79,6 +77,7 @@ class Detection { } finfo_close($finfo); } + $isWrapped = (strpos($path, '://') !== false) and (substr($path, 0, 7) === 'file://'); if (!$isWrapped and $mimeType === 'application/octet-stream' && function_exists("mime_content_type")) { // use mime magic extension if available $mimeType = mime_content_type($path);