diff --git a/e107_handlers/file_class.php b/e107_handlers/file_class.php index 13c8a08fe..d8a396725 100644 --- a/e107_handlers/file_class.php +++ b/e107_handlers/file_class.php @@ -482,14 +482,16 @@ class e_file if(class_exists('finfo')) // Best Mime detection method. { $fin = new finfo(FILEINFO_MIME); - list($mime, $other) = explode(";", $fin->file($path_to_file)); + $result = $fin->file($path_to_file); + $parts = explode(";", $result); + + $mime = trim($parts[0]); if(!empty($mime)) { $finfo['mime'] = $mime; } - unset($other); } @@ -515,7 +517,7 @@ class e_file } - if($imgcheck && ($tmp = getimagesize($path_to_file))) + if($imgcheck && is_file($path_to_file) && ($tmp = getimagesize($path_to_file))) { $finfo['img-width'] = $tmp[0]; $finfo['img-height'] = $tmp[1];