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:
Hani Rouatbi
2025-12-06 15:51:41 +01:00
parent 3cdfa9ce5a
commit e47cf056a0
8 changed files with 66 additions and 16 deletions

View File

@@ -101,7 +101,12 @@ function kleeja_cpatcha_image()
imagepng($image);
//Free up resources
imagedestroy($image);
// 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($image);
}
}
//<--- EOF