]> source.dussan.org Git - nextcloud-server.git/commitdiff
Do not calculate $isWrapped if not needed.
authorAndreas Fischer <bantu@owncloud.com>
Tue, 29 Oct 2013 11:54:30 +0000 (12:54 +0100)
committerAndreas Fischer <bantu@owncloud.com>
Tue, 29 Oct 2013 11:54:30 +0000 (12:54 +0100)
lib/private/files/type/detection.php

index 242a81cb5a4f1097123c9a9c0d7a6732a4231cbd..d8a83382822915e3383e728f2921542f44371e30 100644 (file)
@@ -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);