Skip to content

Commit c559b3c

Browse files
authored
Remove finfo_close call in MIME type detection (#1417)
* Remove finfo_close call in MIME type detection Remove unnecessary finfo_close call after retrieving MIME type for PHP 8.5 compatibility * Update tinyfilemanager.php still be functional in earlier PHP versions.
1 parent cb47ade commit c559b3c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tinyfilemanager.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2588,7 +2588,9 @@ function fm_get_mime_type($file_path)
25882588
if (function_exists('finfo_open')) {
25892589
$finfo = finfo_open(FILEINFO_MIME_TYPE);
25902590
$mime = finfo_file($finfo, $file_path);
2591-
finfo_close($finfo);
2591+
if (\PHP_VERSION_ID < 80000) {
2592+
finfo_close($finfo);
2593+
}
25922594
return $mime;
25932595
} elseif (function_exists('mime_content_type')) {
25942596
return mime_content_type($file_path);

0 commit comments

Comments
 (0)