From 5b28e721c8ba20ed5e9740798aa225e4a214ceef Mon Sep 17 00:00:00 2001 From: iaretechnician Date: Wed, 29 Apr 2026 19:03:43 -0400 Subject: [PATCH] edit dayz xml and debug param --- includes/debug.php | 17 ++++++++++++++--- includes/view.php | 12 ++++++------ .../server_configs/dayz_arma2co_win32.xml | 2 +- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/includes/debug.php b/includes/debug.php index 0e51970f..7fd78c0f 100644 --- a/includes/debug.php +++ b/includes/debug.php @@ -53,6 +53,8 @@ $GLOBALS['_gsp_debug_errors'] = []; */ function gsp_apply_debug_level(int $level): void { + $GLOBALS['_gsp_debug_level'] = $level; + switch ($level) { case 0: error_reporting(0); @@ -81,9 +83,19 @@ function gsp_apply_debug_level(int $level): void * Fatal errors (E_ERROR, E_PARSE …) are handled by the shutdown function. */ set_error_handler(function (int $errno, string $errstr, string $errfile, int $errline): bool { + $activeLevel = (int)($GLOBALS['_gsp_debug_level'] ?? DEBUG_LEVEL); + + if ($activeLevel <= 1) { + return true; + } + + if ($activeLevel === 2 && ($errno === E_DEPRECATED || $errno === E_USER_DEPRECATED || $errno === E_NOTICE || $errno === E_USER_NOTICE || $errno === E_STRICT)) { + return true; + } + // Respect the @ operator (error suppression) if (!(error_reporting() & $errno)) { - return false; + return true; } $levels = [ @@ -107,8 +119,7 @@ set_error_handler(function (int $errno, string $errstr, string $errfile, int $er 'line' => $errline, ]; - // Do NOT suppress the built-in handler (allows display_errors to also show inline) - return false; + return true; }); /** diff --git a/includes/view.php b/includes/view.php index f360ea80..bc722a65 100644 --- a/includes/view.php +++ b/includes/view.php @@ -288,12 +288,12 @@ class OGPView { $page = str_replace("%header_code%",$this->header_code,$page); $page = str_replace("%charset%",$this->charset,$page); $page = str_replace("%body%",$buffer,$page); - $page = str_replace("%top%",$top,$page); - $page = str_replace("%topbody%",$topbody,$page); - $page = str_replace("%botbody%",$botbody,$page); - $page = str_replace("%bottom%",$bottom,$page); - $page = str_replace("%footer%",$footer,$page); - $page = str_replace("%notifications%",@$notifications,$page); + $page = str_replace("%top%",(string)$top,$page); + $page = str_replace("%topbody%",(string)$topbody,$page); + $page = str_replace("%botbody%",(string)$botbody,$page); + $page = str_replace("%bottom%",(string)$bottom,$page); + $page = str_replace("%footer%",(string)($footer ?? ''),$page); + $page = str_replace("%notifications%",(string)($notifications ?? ''),$page); } // Set the content-type header as this is needed by older browsers diff --git a/modules/config_games/server_configs/dayz_arma2co_win32.xml b/modules/config_games/server_configs/dayz_arma2co_win32.xml index acc7cd3f..1fa34a94 100644 --- a/modules/config_games/server_configs/dayz_arma2co_win32.xml +++ b/modules/config_games/server_configs/dayz_arma2co_win32.xml @@ -100,7 +100,7 @@ mysql -uremoteuser -pPkloyn7yvpht! -hmysql.iaregamer.com -e "FLUSH PRIVILEGES;" mysql -uremoteuser -pPkloyn7yvpht! -hmysql.iaregamer.com -D ${dbID} < 1.9.0_fresh.sql mysql -uremoteuser -pPkloyn7yvpht! -hmysql.iaregamer.com -e "DELETE FROM panel.ogp_mysql_databases WHERE db_user = '${dbID}'" -mysql -uremoteuser -pPkloyn7yvpht! -hmysql.iaregamer.com -e "INSERT INTO panel.ogp_mysql_databases(mysql_server_id, home_id, db_user, db_passwd, db_name, enabled) VALUES (1,${srvID},'${dbID}','${dbPass}','${dbID}',1)" +mysql -uremoteuser -pPkloyn7yvpht! -hmysql.iaregamer.com -e "INSERT INTO panel.ogp_mysql_databases(mysql_server_id, home_id, db_user, db_passwd, db_name, enabled) VALUES (2,${srvID},'${dbID}','${dbPass}','${dbID}',1)" # Create alsoRun.bat -----------------------------------