From d0c86926bdd110ee36c89c7d3760e475b62c0bd5 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Mon, 4 May 2026 00:13:49 +0000
Subject: [PATCH] fix: address code review feedback (comment clarity, remove
redundant static array, add CSS class)
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 | 2 +-
modules/config_games/server_config_parser.php | 8 --------
modules/faq/rss_php.php | 1 +
3 files changed, 2 insertions(+), 9 deletions(-)
diff --git a/home.php b/home.php
index 3ccb3519..9759e663 100644
--- a/home.php
+++ b/home.php
@@ -234,7 +234,7 @@ function ogpHome()
if ($isAdmin) {
$xml_errors = function_exists('gsp_get_xml_errors') ? gsp_get_xml_errors() : array();
if (!empty($xml_errors)) {
- echo "
";
+ echo "
";
echo "
⚠ One or more game config XML files failed to load and have been skipped:";
foreach ($xml_errors as $xe) {
echo "" . htmlspecialchars(basename($xe['file']), ENT_QUOTES, 'UTF-8') . ": "
diff --git a/modules/config_games/server_config_parser.php b/modules/config_games/server_config_parser.php
index b3f59133..b7121659 100644
--- a/modules/config_games/server_config_parser.php
+++ b/modules/config_games/server_config_parser.php
@@ -63,14 +63,6 @@ if (!function_exists('gsp_collect_xml_error')) {
$log_message = "[GSP] $title" . (empty($details) ? '' : ' Details: ' . $details);
error_log($log_message);
- static $errors = [];
- $errors[] = array(
- 'file' => $file,
- 'title' => $title,
- 'details' => $details,
- );
- // Store in a predictable global so callers (e.g. home.php) can read it
- // even across include boundaries without having to call the function.
$GLOBALS['_gsp_xml_errors'][] = array(
'file' => $file,
'title' => $title,
diff --git a/modules/faq/rss_php.php b/modules/faq/rss_php.php
index 328d5537..7c6ec8f7 100644
--- a/modules/faq/rss_php.php
+++ b/modules/faq/rss_php.php
@@ -76,6 +76,7 @@ class rss_php {
$rss = ltrim($rss);
// Reject obviously non-XML content early to avoid noisy libxml warnings.
+ // Minimum well-formed XML is at least "" (4 bytes); require one more.
if(strlen($rss) < 5 || $rss[0] !== '<') {
return;
}