Permalink
Browse files

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()
  • Loading branch information...
1 parent e2aa635 commit c9bcfd49ec3245a1cc5856e63735f61cf7a7c532 @halkyon halkyon committed May 17, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 control/HTTP.php
View
@@ -204,7 +204,7 @@ public static function getMimeType($filename) {
*/
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);
}

0 comments on commit c9bcfd4

Please sign in to comment.