diff options
author | Phil Davis <phil.davis@inf.org> | 2017-01-23 14:27:52 +0545 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2017-01-23 18:15:04 -0200 |
commit | 5af7e158ec444cc186235ce64a4d03ef37bdf230 (patch) | |
tree | c6e3ab7c1d234445e57a6c30d720cbdc0db4d6f2 /src | |
parent | a53cd6c8e364a70a8e03d51f116c4e19d809f7d2 (diff) | |
download | pfsense-5af7e158ec444cc186235ce64a4d03ef37bdf230.zip pfsense-5af7e158ec444cc186235ce64a4d03ef37bdf230.tar.gz |
Interface description must be unique including case
(cherry picked from commit 3692adec74d438eedb41a7be8eae9cd58f6fe5c1)
Diffstat (limited to 'src')
-rw-r--r-- | src/usr/local/www/firewall_aliases_edit.php | 2 | ||||
-rw-r--r-- | 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 0484ce3..20dca5f 100644 --- a/src/usr/local/www/firewall_aliases_edit.php +++ b/src/usr/local/www/firewall_aliases_edit.php @@ -196,7 +196,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 136f2b8..24192d3 100644 --- a/src/usr/local/www/interfaces.php +++ b/src/usr/local/www/interfaces.php @@ -520,7 +520,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; } @@ -529,7 +529,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']); } } @@ -538,7 +538,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 c6bea22..42f1368 100644 --- a/src/usr/local/www/interfaces_groups_edit.php +++ b/src/usr/local/www/interfaces_groups_edit.php @@ -120,7 +120,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."; } } |