fix: address code review nits - simplify array_map lambda and clarify empty remote_server_id

Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/e8bfe531-e1ff-4257-b49c-f8376b84e772

Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-05-02 15:42:09 +00:00 committed by GitHub
parent 3024e41121
commit 744964ac60
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View file

@ -114,6 +114,8 @@ function sync_billing_services(mysqli $db, string $prefix): array
}
$svcName = $db->real_escape_string($gm['mod_name'] ?: $gm['game_name']);
$homeCfgId = (int)$gm['home_cfg_id'];
// remote_server_id is intentionally empty: no servers are assigned until
// an admin reviews and enables the service on the adminserverlist page.
$db->query(
"INSERT INTO `{$prefix}billing_services`
(home_cfg_id, mod_cfg_id, service_name, description,

View file

@ -55,7 +55,7 @@ function gsp_normalize_config_value($value): string
}
if ($isFlat) {
return implode(',', array_map(function ($item) {
return $item instanceof SimpleXMLElement ? (string)$item : (string)$item;
return (string)$item;
}, $value));
}
return json_encode($value, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);