1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-03 13:17:24 +02:00
This commit is contained in:
camer0n
2025-04-01 12:01:44 -07:00
parent a459332e10
commit ec5a16b3eb

View File

@@ -482,14 +482,16 @@ class e_file
if(class_exists('finfo')) // Best Mime detection method. if(class_exists('finfo')) // Best Mime detection method.
{ {
$fin = new finfo(FILEINFO_MIME); $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)) if(!empty($mime))
{ {
$finfo['mime'] = $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-width'] = $tmp[0];
$finfo['img-height'] = $tmp[1]; $finfo['img-height'] = $tmp[1];