From 88c066a8f5f7319d852a1b474a2c3bd00b9ebb6e Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Mon, 27 Jan 2025 09:52:04 +0100 Subject: [PATCH] ErrorHandling/Fixup * do not write to STDERR from web context --- includes/kernel.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/kernel.php b/includes/kernel.php index ad463e3f..5a8d5527 100644 --- a/includes/kernel.php +++ b/includes/kernel.php @@ -153,8 +153,10 @@ register_shutdown_function(function() AOWOW_REVISION, $e['type'], $e['file'], $e['line'], CLI ? 'CLI' : ($_SERVER['QUERY_STRING'] ?? ''), empty($_POST) ? '' : http_build_query($_POST), User::$groups, $e['message'] ); - if (CLI || User::isInGroup(U_GROUP_EMPLOYEE)) + if (CLI) fwrite(STDERR, "\nFatal Error - ".$e['message'].' @ '.$e['file']. ':'.$e['line']."\n\n"); + else if (User::isInGroup(U_GROUP_EMPLOYEE)) + echo "\nFatal Error - ".$e['message'].' @ '.$e['file']. ':'.$e['line']."\n\n"; } });