Return early if fileinfo is there.
This commit is contained in:
parent
68d13210bd
commit
fa6ae81149
|
@ -74,6 +74,7 @@ class Detection {
|
||||||
$info = @strtolower(finfo_file($finfo, $path));
|
$info = @strtolower(finfo_file($finfo, $path));
|
||||||
if ($info) {
|
if ($info) {
|
||||||
$mimeType = substr($info, 0, strpos($info, ';'));
|
$mimeType = substr($info, 0, strpos($info, ';'));
|
||||||
|
return empty($mimeType) ? 'application/octet-stream' : $mimeType;
|
||||||
}
|
}
|
||||||
finfo_close($finfo);
|
finfo_close($finfo);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue