Return early if fileinfo is there.

This commit is contained in:
Andreas Fischer 2013-10-29 13:36:37 +01:00
parent 68d13210bd
commit fa6ae81149
1 changed files with 1 additions and 0 deletions

View File

@ -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);
} }