From ccf10e3f47b3add83210778c25dccc63b2c8ce67 Mon Sep 17 00:00:00 2001 From: Miraty Date: Wed, 10 Apr 2024 00:53:29 +0200 Subject: [PATCH] response code only over http in exception handler --- init.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init.php b/init.php index d57eba6..b89a0fe 100644 --- a/init.php +++ b/init.php @@ -9,7 +9,8 @@ set_error_handler(function ($level, $message, $file = '', $line = 0) { }); set_exception_handler(function ($e) { error_log((string) $e); - http_response_code(500); + if (http_response_code() !== false) + http_response_code(500); echo '

Error

An error occured.

' . LF; }); register_shutdown_function(function () { // Also catch fatal errors