Update finfo_close PHP version check to 8.1

Adjusted the conditional to only call finfo_close for PHP versions below 8.1, reflecting that finfo_close has no effect since PHP 8.1 instead of 8.0.
This commit is contained in:
Hani Rouatbi
2025-12-07 13:05:51 +01:00
parent e47cf056a0
commit 9a14d9079a
4 changed files with 8 additions and 7 deletions

View File

@@ -226,9 +226,10 @@ function check_mime_type($given_file_mime, $file_ext, $file_path)
{
$f_info = finfo_open(FILEINFO_MIME_TYPE);
$mime = finfo_file($f_info, $file_path);
// finfo_close() has no effect since PHP 8.0
// Only call it for PHP < 8.0 where it actually closes the resource
if (PHP_VERSION_ID < 80000)
// finfo_close() has no effect since PHP 8.1
// Only call it for PHP < 8.1 where it actually closes the resource
if (PHP_VERSION_ID < 80100)
{
finfo_close($f_info);
}