From 5c463d381fb28a7ca30a8913431641e201ff7cc6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 4 May 2026 00:12:39 +0000 Subject: [PATCH 1/2] fix: FAQ PHP warnings, billing nav, XML fatal-skip, Steam Workshop user menu Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/86bb1e0e-2bbd-439b-88cd-7a624ad24761 Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com> --- home.php | 26 +++++++++ modules/billing/module.php | 9 ++-- modules/config_games/server_config_parser.php | 53 +++++++++++++++++-- modules/faq/rss_php.php | 19 ++++++- modules/steam_workshop/module.php | 5 -- modules/steam_workshop/navigation.xml | 4 +- 6 files changed, 98 insertions(+), 18 deletions(-) diff --git a/home.php b/home.php index 31be3f63..3ccb3519 100644 --- a/home.php +++ b/home.php @@ -187,6 +187,12 @@ function ogpHome() foreach ((array)$servers_by_game_name as $game_name => $server_homes ) { $server_xml = read_server_config(SERVER_CONFIG_LOCATION."/".$server_homes[0]['home_cfg_file']); + if ($server_xml === FALSE) + { + // Bad XML – skip this game from the navigation list; error is + // already collected and will be shown to admins below. + continue; + } $mod = $server_homes[0]['mod_key']; // If query name does not exist use mod key instead. if ($server_xml->protocol == "gameq") @@ -223,6 +229,26 @@ function ogpHome() } else $game_homes_list = ""; + + // Show admin-only warning for any game config XMLs that failed to parse. + if ($isAdmin) { + $xml_errors = function_exists('gsp_get_xml_errors') ? gsp_get_xml_errors() : array(); + if (!empty($xml_errors)) { + echo "
" . htmlspecialchars(basename($xe['file']), ENT_QUOTES, 'UTF-8') . ": "
+ . htmlspecialchars($xe['title'], ENT_QUOTES, 'UTF-8');
+ if (!empty($xe['details'])) {
+ echo " — " . nl2br(htmlspecialchars($xe['details'], ENT_QUOTES, 'UTF-8')) . "";
+ }
+ echo "Use Game/Mod Config to edit and fix the broken file(s).
"; + echo "