diff options
author | stilez <stilez@users.noreply.github.com> | 2016-09-18 08:52:13 +0100 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2016-12-30 09:53:50 -0200 |
commit | 82e6451ece60b16b0f225e4292a0c20b43d17606 (patch) | |
tree | d3dc6e3b27fb7f9b9c389e125839393407fc83c1 /src/usr/local/www/firewall_rules.php | |
parent | 6ab670c2ee44d40b5fa7739dc8111e56e1f75024 (diff) | |
download | pfsense-82e6451ece60b16b0f225e4292a0c20b43d17606.zip pfsense-82e6451ece60b16b0f225e4292a0c20b43d17606.tar.gz |
simplify avoiding loop. Also localise with gettext()
(cherry picked from commit 16b91b19e08e0778522c16e811754c22f03b5150)
Diffstat (limited to 'src/usr/local/www/firewall_rules.php')
-rw-r--r-- | src/usr/local/www/firewall_rules.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/usr/local/www/firewall_rules.php b/src/usr/local/www/firewall_rules.php index fbdf37a..b2e58c7 100644 --- a/src/usr/local/www/firewall_rules.php +++ b/src/usr/local/www/firewall_rules.php @@ -720,10 +720,14 @@ foreach ($a_filter as $filteri => $filterent): echo strtoupper($filterent['protocol']); if (strtoupper($filterent['protocol']) == "ICMP" && !empty($filterent['icmptype'])) { - $t = array(); - foreach (explode(',', $filterent['icmptype']) as $type) { - $t[] = $icmptypes[$type]['descrip']; - } + // replace each comma-separated icmptype item by its (localised) full description + $t = array_map( + function($type) { + global $icmptypes; + return gettext($icmptypes[$type]['descrip']); + }, + explode(',', $filterent['icmptype']) + ); echo sprintf(' <span style="cursor: help;" title="%s:%s%s"><u>%s</u></span>', gettext('ICMP subtypes'), chr(13), implode(', ', $t), $filterent['icmptype']); } } else echo " *"; |