mirror of
https://github.com/kleeja-official/kleeja.git
synced 2025-12-16 04:59:42 +01:00
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:
@@ -67,7 +67,7 @@ error_reporting(defined('DEV_STAGE') ? E_ALL : E_ALL ^ E_NOTICE);
|
||||
function kleeja_show_error($error_number, $error_string = '', $error_file = '', $error_line = '')
|
||||
{
|
||||
// Check if error reporting is disabled (happens with @ operator)
|
||||
if (!(error_reporting() & $error_number))
|
||||
if (! (error_reporting() & $error_number))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user