From 62218b4dc41723f313350a5d4152c98f4a1c6d80 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Fri, 26 Sep 2014 08:25:41 +0545 Subject: Remove useless check for alias description matching an interface description While looking at other checks in the code I noticed this check. It was not effective anyway, because the first line inside "if ($_POST)" below does unset($input_errors); which undoes this check anyway. In any case the check is not relevant. For example I might have interface WAN with description (which is really the alternate/display name for an interface) as MYISP. I cannot also have an Alias with name MYISP - that is checked for already later in the code. But I can have an Alias with description MYISP - in the case of an Alias the description really is just helpful text for the user, it is the name that really counts for use in the pf configuration. So the code is not needed. --- usr/local/www/firewall_aliases_edit.php | 6 ------ 1 file changed, 6 deletions(-) (limited to 'usr') diff --git a/usr/local/www/firewall_aliases_edit.php b/usr/local/www/firewall_aliases_edit.php index 8931edc..2b375ec 100755 --- a/usr/local/www/firewall_aliases_edit.php +++ b/usr/local/www/firewall_aliases_edit.php @@ -107,12 +107,6 @@ if (isset($id) && $a_aliases[$id]) { $pconfig['type'] = $a_aliases[$id]['type']; $pconfig['descr'] = html_entity_decode($a_aliases[$id]['descr']); - /* interface list */ - $iflist = get_configured_interface_with_descr(false, true); - foreach ($iflist as $if => $ifdesc) - if($ifdesc == $pconfig['descr']) - $input_errors[] = sprintf(gettext("Sorry, an interface is already named %s."), $pconfig['descr']); - if(preg_match("/urltable/i", $a_aliases[$id]['type'])) { $pconfig['address'] = $a_aliases[$id]['url']; $pconfig['updatefreq'] = $a_aliases[$id]['updatefreq']; -- cgit v1.1