From c9e9606b2d15290316396b014f32a3804a6d9be3 Mon Sep 17 00:00:00 2001 From: lin-xianming <108489988+lin-xianming@users.noreply.github.com> Date: Tue, 27 Feb 2024 02:50:23 -0500 Subject: [PATCH] firewall/rules: fix floating rule display (#7283) 1. For a floating rule with a single interface group, the interface count and tooltip did not show when viewed from an interface rules page. 2. For a floating rule with an interface group and at least one other interface or interface group, the entire rule did not show when viewed from an interface rules page for which the interface is contained in one of the interface groups. --- src/www/firewall_rules.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/www/firewall_rules.php b/src/www/firewall_rules.php index a54de2f62..e674d498e 100644 --- a/src/www/firewall_rules.php +++ b/src/www/firewall_rules.php @@ -771,7 +771,7 @@ $( document ).ready(function() { } elseif (($rule->getInterface() == "" || strpos($rule->getInterface(), ",") !== false) && $selected_if == "FloatingRules") { // floating type of rule and "floating" view $is_selected = true; - } elseif ($rule->getInterface() == "" || in_array($selected_if, explode(',', $rule->getInterface())) || in_array($rule->getInterface(), $ifgroups)) { + } elseif ($rule->getInterface() == "" || !empty(array_intersect(array_merge([$selected_if], $ifgroups), explode(',', $rule->getInterface())))) { // rule is floating or of group type and matches this interface $is_selected = true; } @@ -836,7 +836,7 @@ $( document ).ready(function() { - + getInterface() || $selected_if == 'FloatingRules'): ?> getRawRule()['interfacenot']) ? '!' : '';?>