summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2017-02-01 09:42:52 +0545
committerRenato Botelho <renato@netgate.com>2017-02-01 07:42:03 -0200
commit1767e1c64a3aa82880bffa925c7e922ecdbcf16a (patch)
treef0e3265ee8d5658d04d85071785efb5ae1065592 /src/usr
parente8942021efbf16f999ef34ec6594bfeab2baaa00 (diff)
downloadpfsense-1767e1c64a3aa82880bffa925c7e922ecdbcf16a.zip
pfsense-1767e1c64a3aa82880bffa925c7e922ecdbcf16a.tar.gz
Fix #7183 Do not allow Interface Groups with the same name
I should stop trying bad stuff, there seem to be so many holes to find in the validation :) (cherry picked from commit 89ac71d38a4c49e1537e4afe2b34b2457d9817a7)
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/local/www/interfaces_groups_edit.php8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/usr/local/www/interfaces_groups_edit.php b/src/usr/local/www/interfaces_groups_edit.php
index 1394c69..d215288 100644
--- a/src/usr/local/www/interfaces_groups_edit.php
+++ b/src/usr/local/www/interfaces_groups_edit.php
@@ -97,11 +97,9 @@ if ($_POST) {
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
if (!$input_errors) {
- if (!isset($id)) {
- foreach ($a_ifgroups as $groupentry) {
- if ($groupentry['ifname'] == $_POST['ifname']) {
- $input_errors[] = gettext("Group name already exists!");
- }
+ foreach ($a_ifgroups as $groupid => $groupentry) {
+ if ((!isset($id) || ($groupid != $id)) && ($groupentry['ifname'] == $_POST['ifname'])) {
+ $input_errors[] = gettext("Group name already exists!");
}
}
OpenPOWER on IntegriCloud