Merge pull request #70 from GameServerPanel/copilot/fix-undefined-array-key-error

This commit is contained in:
Frank Harris 2026-04-30 05:43:17 -07:00 committed by GitHub
commit 2a99becc4d
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;