Check that selected is an array

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-05-28 15:15:31 +01:00
parent 92eb6eb1b6
commit 6b41970e97

View file

@ -875,13 +875,19 @@ class Helper
$permission_name = $permission[$x]['permission'];
if ($permission[$x]['display'] === true) {
if ($selected_arr) {
if (is_array($selected_arr)) {
\Log::debug('$selected_arr is an array');
if (array_key_exists($permission_name, $selected_arr)) {
\Log::debug($permission_name. ' exists in $selected_arr');
$permissions_arr[$permission_name] = $selected_arr[$permission_name];
} else {
$permissions_arr[$permission_name] = '0';
}
} else {
\Log::debug('$selected_arr is NOT array');
$permissions_arr[$permission_name] = '0';
}
}