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:
@@ -66,9 +66,15 @@ 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))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
switch ($error_number)
|
||||
{
|
||||
case E_NOTICE: case E_WARNING: case E_USER_WARNING: case E_USER_NOTICE: case E_STRICT:
|
||||
case E_NOTICE: case E_WARNING: case E_USER_WARNING: case E_USER_NOTICE: case 2048: // E_STRICT (deprecated in PHP 8.4, using numeric value for compatibility)
|
||||
if (function_exists('kleeja_log'))
|
||||
{
|
||||
$error_name = [
|
||||
@@ -81,6 +87,7 @@ function kleeja_show_error($error_number, $error_string = '', $error_file = '',
|
||||
|
||||
default:
|
||||
header('HTTP/1.1 503 Service Temporarily Unavailable');
|
||||
echo '<!DOCTYPE html>' . "\n";
|
||||
echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">' . "\n<head>\n";
|
||||
echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />' . "\n";
|
||||
echo '<title>Kleeja Error</title>' . "\n" . '<style type="text/css">' . "\n\t";
|
||||
|
||||
Reference in New Issue
Block a user