Projet

Général

Profil

« Précédent | Suivant » 

Révision 62218b4d

Ajouté par Phil Davis il y a plus de 9 ans

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.

Voir les différences:

usr/local/www/firewall_aliases_edit.php
107 107
	$pconfig['type'] = $a_aliases[$id]['type'];
108 108
	$pconfig['descr'] = html_entity_decode($a_aliases[$id]['descr']);
109 109

  
110
	/* interface list */
111
	$iflist = get_configured_interface_with_descr(false, true);
112
	foreach ($iflist as $if => $ifdesc)
113
		if($ifdesc == $pconfig['descr'])
114
			$input_errors[] = sprintf(gettext("Sorry, an interface is already named %s."), $pconfig['descr']);
115

  
116 110
	if(preg_match("/urltable/i", $a_aliases[$id]['type'])) {
117 111
		$pconfig['address'] = $a_aliases[$id]['url'];
118 112
		$pconfig['updatefreq'] = $a_aliases[$id]['updatefreq'];

Formats disponibles : Unified diff