Skip to content
Snippets Groups Projects
Commit 8de9758f authored by Thomas Müller's avatar Thomas Müller
Browse files

Merge pull request #7071 from jcfischer/master

close statement in MimeType detection is executed [#7069]
parents e7db48cd 11f46e12
Branches
No related tags found
No related merge requests found
......@@ -72,11 +72,12 @@ class Detection {
and function_exists('finfo_file') and $finfo = finfo_open(FILEINFO_MIME)
) {
$info = @strtolower(finfo_file($finfo, $path));
finfo_close($finfo);
if ($info) {
$mimeType = substr($info, 0, strpos($info, ';'));
return empty($mimeType) ? 'application/octet-stream' : $mimeType;
}
finfo_close($finfo);
}
$isWrapped = (strpos($path, '://') !== false) and (substr($path, 0, 7) === 'file://');
if (!$isWrapped and $mimeType === 'application/octet-stream' && function_exists("mime_content_type")) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment