From c9bcfd49ec3245a1cc5856e63735f61cf7a7c532 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Thu, 17 May 2012 14:53:40 +1200 Subject: [PATCH] BUGFIX Only use finfo if the file exists, otherwise the MIME type detection won't work, such as in the case of HTTPRequest::send_file() --- control/HTTP.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/control/HTTP.php b/control/HTTP.php index 9d09f81b0..924d2f95c 100644 --- a/control/HTTP.php +++ b/control/HTTP.php @@ -204,7 +204,7 @@ class HTTP { */ public static function get_mime_type($filename) { // If the finfo module is compiled into PHP, use it. - if(class_exists('finfo')) { + if(class_exists('finfo') && file_exists($filename)) { $finfo = new finfo(FILEINFO_MIME_TYPE); return $finfo->file(BASE_PATH . DIRECTORY_SEPARATOR . $filename); }