diff options
author | Phil Davis <phil.davis@inf.org> | 2017-01-23 14:27:52 +0545 |
---|---|---|
committer | Phil Davis <phil.davis@inf.org> | 2017-01-23 14:27:52 +0545 |
commit | 3692adec74d438eedb41a7be8eae9cd58f6fe5c1 (patch) | |
tree | d1f757de9c525f39a1f349ab0c6ed0bd3fab9ba0 /src/usr/local | |
parent | b2bb49709d6d1cb845f2c7caf40bebe375ecb2d7 (diff) | |
download | pfsense-3692adec74d438eedb41a7be8eae9cd58f6fe5c1.zip pfsense-3692adec74d438eedb41a7be8eae9cd58f6fe5c1.tar.gz |
Interface description must be unique including case
Diffstat (limited to 'src/usr/local')
-rw-r--r-- | src/usr/local/www/firewall_aliases_edit.php | 2 | ||||
-rwxr-xr-x | src/usr/local/www/interfaces.php | 6 | ||||
-rw-r--r-- | src/usr/local/www/interfaces_groups_edit.php | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/usr/local/www/firewall_aliases_edit.php b/src/usr/local/www/firewall_aliases_edit.php index 7053390..161960b 100644 --- a/src/usr/local/www/firewall_aliases_edit.php +++ b/src/usr/local/www/firewall_aliases_edit.php @@ -175,7 +175,7 @@ if ($_POST) { /* check for name interface description conflicts */ foreach ($config['interfaces'] as $interface) { - if ($interface['descr'] == $_POST['name']) { + if (strcasecmp($interface['descr'], $_POST['name']) == 0) { $input_errors[] = gettext("An interface description with this name already exists."); break; } diff --git a/src/usr/local/www/interfaces.php b/src/usr/local/www/interfaces.php index 6010b95..32992a5 100755 --- a/src/usr/local/www/interfaces.php +++ b/src/usr/local/www/interfaces.php @@ -490,7 +490,7 @@ if ($_POST['apply']) { } /* description unique? */ foreach ($ifdescrs as $ifent => $ifdescr) { - if ($if != $ifent && $ifdescr == $_POST['descr']) { + if ($if != $ifent && (strcasecmp($ifdescr, $_POST['descr']) == 0)) { $input_errors[] = gettext("An interface with the specified description already exists."); break; } @@ -499,7 +499,7 @@ if ($_POST['apply']) { /* Is the description already used as an alias name? */ if (is_array($config['aliases']['alias'])) { foreach ($config['aliases']['alias'] as $alias) { - if ($alias['name'] == $_POST['descr']) { + if (strcasecmp($alias['name'], $_POST['descr']) == 0) { $input_errors[] = sprintf(gettext("Sorry, an alias with the name %s already exists."), $_POST['descr']); } } @@ -508,7 +508,7 @@ if ($_POST['apply']) { /* Is the description already used as an interface group name? */ if (is_array($config['ifgroups']['ifgroupentry'])) { foreach ($config['ifgroups']['ifgroupentry'] as $ifgroupentry) { - if ($ifgroupentry['ifname'] == $_POST['descr']) { + if (strcasecmp($ifgroupentry['ifname'], $_POST['descr']) == 0) { $input_errors[] = sprintf(gettext("Sorry, an interface group with the name %s already exists."), $wancfg['descr']); } } diff --git a/src/usr/local/www/interfaces_groups_edit.php b/src/usr/local/www/interfaces_groups_edit.php index b8f4449..127cad6 100644 --- a/src/usr/local/www/interfaces_groups_edit.php +++ b/src/usr/local/www/interfaces_groups_edit.php @@ -89,7 +89,7 @@ if ($_POST) { } foreach ($interface_list_disabled as $gif => $gdescr) { - if ($gdescr == $_POST['ifname'] || $gif == $_POST['ifname']) { + if ((strcasecmp($gdescr, $_POST['ifname']) == 0) || (strcasecmp($gif, $_POST['ifname']) == 0)) { $input_errors[] = "The specified group name is already used by an interface. Please choose another name."; } } |