From 32edd5dd7962c7767f2cdefaba0e0b1f0f759d50 Mon Sep 17 00:00:00 2001 From: Steve Beaver Date: Mon, 18 Dec 2017 08:39:57 -0500 Subject: [PATCH] Optimze ICMP description processing --- src/usr/local/www/firewall_rules_edit.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/usr/local/www/firewall_rules_edit.php b/src/usr/local/www/firewall_rules_edit.php index 10aa64710a..e4457a3229 100644 --- a/src/usr/local/www/firewall_rules_edit.php +++ b/src/usr/local/www/firewall_rules_edit.php @@ -42,14 +42,16 @@ $icmptypes46 = array('any' => gettext('any')); // ICMP descriptions may be translated, so require escaping to handle single quotes (in particular) foreach ($icmptypes as $k => $v) { + $description = addslashes($v['descrip']); + if ($v['valid4']) { - $icmptypes4[$k] = addslashes($v['descrip']); + $icmptypes4[$k] = $description; if ($v['valid6']) { - $icmptypes6[$k] = addslashes($v['descrip']); - $icmptypes46[$k] = addslashes($v['descrip']); + $icmptypes6[$k] = $description; + $icmptypes46[$k] = $description; } } else { - $icmptypes6[$k] = addslashes($v['descrip']); + $icmptypes6[$k] = $description; } }