From 6256ea2e50eda123efa6867ed93022b6f363eae1 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 2 Aug 2023 08:01:38 +0200 Subject: [PATCH] firewall: fix a couple of warnings on the rules page --- src/www/firewall_rules.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/www/firewall_rules.php b/src/www/firewall_rules.php index 412eb1151..31a27baed 100644 --- a/src/www/firewall_rules.php +++ b/src/www/firewall_rules.php @@ -115,20 +115,22 @@ 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' && !empty($filterent['icmptype'])) { $result = $record_ipprotocol; + $icmplabel = $icmptypes[$filterent['icmptype']] ?? $filterent['icmptype']; $result .= sprintf( - " %s ", - html_safe($icmptypes[$filterent['icmptype']]), - isset($filterent['protocol']) ? strtoupper($filterent['protocol']) : "*" + '%s', + html_safe($icmplabel), + isset($filterent['protocol']) ? strtoupper($filterent['protocol']) : '*' ); return $result; } elseif (isset($filterent['protocol']) && !empty($filterent['icmp6-type'])) { $result = $record_ipprotocol; + $icmplabel = $icmp6types[$filterent['icmp6-type']] ?? $filterent['icmp6-type']; $result .= sprintf( - " %s ", - html_safe($icmp6types[$filterent['icmp6-type']]), - isset($filterent['protocol']) ? strtoupper($filterent['protocol']) : "*" + '%s', + html_safe($icmplabel), + isset($filterent['protocol']) ? strtoupper($filterent['protocol']) : '*' ); return $result; } else { @@ -980,7 +982,7 @@ $( document ).ready(function() { - +