mirror of
https://github.com/kleeja-official/kleeja.git
synced 2026-04-10 01:48:45 +02: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:
@@ -131,7 +131,12 @@ class FetchFile
|
||||
kleeja_log(sprintf("cUrl error (#%d): %s\n", curl_errno($ch), htmlspecialchars(curl_error($ch))));
|
||||
}
|
||||
|
||||
curl_close($ch);
|
||||
// curl_close() has no effect since PHP 8.0
|
||||
// Only call it for PHP < 8.0 where it actually closes the handle
|
||||
if (PHP_VERSION_ID < 80000)
|
||||
{
|
||||
curl_close($ch);
|
||||
}
|
||||
fclose($out);
|
||||
|
||||
return isset($error) ? false : true;
|
||||
@@ -146,7 +151,12 @@ class FetchFile
|
||||
kleeja_log(sprintf("FetchFile error (curl: #%d): %s\n", curl_errno($ch), htmlspecialchars(curl_error($ch))));
|
||||
}
|
||||
|
||||
curl_close($ch);
|
||||
// curl_close() has no effect since PHP 8.0
|
||||
// Only call it for PHP < 8.0 where it actually closes the handle
|
||||
if (PHP_VERSION_ID < 80000)
|
||||
{
|
||||
curl_close($ch);
|
||||
}
|
||||
|
||||
return isset($error) ? false : $data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user