From aecbab5c36db122bc1151c1d0c50496fed05557c Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Mon, 7 Sep 2020 14:13:53 +0200 Subject: [PATCH] Fix variable type for array_flip instruction --- pandora_console/include/functions_events.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 9e620e70ef..9f8cfdbf08 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -1042,7 +1042,13 @@ function events_get_all( $tags = json_decode($tag_with, true); if (is_array($tags) && !in_array('0', $tags)) { if (!$user_is_admin) { - $user_tags = array_flip(tags_get_tags_for_module_search()); + $getUserTags = tags_get_tags_for_module_search(); + // Prevent false value for array_flip + if ($getUserTags === false) { + $getUserTags = []; + } + + $user_tags = array_flip($getUserTags); if ($user_tags != null) { foreach ($tags as $id_tag) { // User cannot filter with those tags.