fix: resolve three server-start errors (home_id warning, cfg_text_replace TypeError)

Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/9cc2a00d-58ae-48d6-91e3-e52fae97426c

Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-04-30 12:38:13 +00:00 committed by GitHub
parent e81e63bf1b
commit 184c0bbfd7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -52,7 +52,7 @@ $replace_texts = $server_xml->replace_texts->text;
$replace_id = 0;
if($replace_texts)
{
foreach ((array)$replace_texts as $text => $array )
foreach ($replace_texts as $array )
{
$param = (string)$array['key'];
@ -85,7 +85,7 @@ $custom_fields = json_decode($db->getCustomFields($server_home["home_id"]), True
$fields = $server_xml->custom_fields->field;
if($fields)
{
foreach ((array)$fields as $text => $array )
foreach ($fields as $array )
{
foreach ((array)$array as $key => $value )
{

View file

@ -164,7 +164,7 @@ function exec_ogp_module() {
$stats_players = 0;
$stats_maxplayers = 0;
$home_id = $_GET['home_id'];
$home_id = $_GET['home_id'] ?? null;
$home_info = $db->getGameHomeWithoutMods($home_id);
$home_page = (isset($_GET['page']) && (int)$_GET['page'] > 0) ? (int)$_GET['page'] : 1;