From b7136e75c313b0ccaab0725797d9088f7efe4e66 Mon Sep 17 00:00:00 2001 From: lin-xianming <108489988+lin-xianming@users.noreply.github.com> Date: Mon, 4 Mar 2024 03:25:34 -0500 Subject: [PATCH] firewall/rules: fix display of ICMP tooltip (#7289) The tooltip was missing when the ICMP type is all. --- src/www/firewall_rules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/www/firewall_rules.php b/src/www/firewall_rules.php index e674d498e..ca481880b 100644 --- a/src/www/firewall_rules.php +++ b/src/www/firewall_rules.php @@ -115,18 +115,18 @@ function firewall_rule_item_proto($filterent) "mtraceresp" => gettext("mtrace response"), "mtrace" => gettext("mtrace messages") ); - if (isset($filterent['protocol']) && $filterent['protocol'] == 'icmp' && !empty($filterent['icmptype'])) { + if (isset($filterent['protocol']) && $filterent['protocol'] == 'icmp') { $result = $record_ipprotocol; - $icmplabel = $icmptypes[$filterent['icmptype']] ?? $filterent['icmptype']; + $icmplabel = $icmptypes[$filterent['icmptype'] ?? ''] ?? $filterent['icmptype']; $result .= sprintf( '%s', html_safe($icmplabel), isset($filterent['protocol']) ? strtoupper($filterent['protocol']) : '*' ); return $result; - } elseif (isset($filterent['protocol']) && !empty($filterent['icmp6-type'])) { + } elseif (isset($filterent['protocol']) && $filterent['protocol'] == 'ipv6-icmp') { $result = $record_ipprotocol; - $icmplabel = $icmp6types[$filterent['icmp6-type']] ?? $filterent['icmp6-type']; + $icmplabel = $icmp6types[$filterent['icmp6-type'] ?? ''] ?? $filterent['icmp6-type']; $result .= sprintf( '%s', html_safe($icmplabel),