Add PHP 8 array guards in gamemanager and addonsmanager modules

Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/88949fe0-8891-483a-b5c5-952bc209748d

Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-04-20 12:39:25 +00:00 committed by GitHub
parent 5b80f144e4
commit 54e7f07aa0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 141 additions and 63 deletions

View file

@ -26,13 +26,16 @@ $query_groups = "";
if($_SESSION['users_role'] != "admin")
{
$groups = $db->getUsersGroups($_SESSION['user_id']);
if (!is_array($groups)) {
$groups = [];
}
$query_groups .= " AND (";
foreach($groups as $group)
$query_groups .= "group_id=".$group['group_id']." OR ";
$query_groups .= "group_id=0 OR group_id IS NULL)";
}
$addons = $db->resultQuery("SELECT addon_id FROM OGP_DB_PREFIXaddons WHERE home_cfg_id=".$server_home['home_cfg_id'].$query_groups);
$addons_qty = count($addons);
$addons_qty = is_array($addons) ? count($addons) : 0;
if($addons and $addons_qty >= 1){
$module_buttons = array(
"<a class='monitorbutton' href='?m=addonsmanager&amp;p=user_addons&amp;home_id=".
@ -45,4 +48,4 @@ if($addons and $addons_qty >= 1){
}
else
$module_buttons = array();
?>
?>