mirror of
https://github.com/kleeja-official/kleeja.git
synced 2025-12-16 04:59:42 +01:00
Add PHP 8.5 support
Updated calls to resource cleanup functions (curl_close, imagedestroy, finfo_close) to only execute for PHP versions below 8.0, as these functions have no effect in PHP 8+. Improved error handling and connection management in mysqli and sqlite drivers, and added missing DOCTYPE in error output for better HTML compliance.
This commit is contained in:
@@ -226,7 +226,12 @@ 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($f_info);
|
||||
// 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($f_info);
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif (! empty($given_file_mime))
|
||||
|
||||
@@ -178,8 +178,13 @@ function helper_thumb($source_path, $ext, $dest_image, $dw, $dh)
|
||||
$return = false;
|
||||
}
|
||||
|
||||
@imagedestroy($desired_gdim);
|
||||
@imagedestroy($source_gdim);
|
||||
// imagedestroy() has no effect since PHP 8.0
|
||||
// Only call it for PHP < 8.0 where it actually frees memory
|
||||
if (PHP_VERSION_ID < 80000)
|
||||
{
|
||||
imagedestroy($desired_gdim);
|
||||
imagedestroy($source_gdim);
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user