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:
parent
5b80f144e4
commit
54e7f07aa0
13 changed files with 141 additions and 63 deletions
|
|
@ -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&p=user_addons&home_id=".
|
||||
|
|
@ -45,4 +48,4 @@ if($addons and $addons_qty >= 1){
|
|||
}
|
||||
else
|
||||
$module_buttons = array();
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue