diff options
author | Phil Davis <phil.davis@inf.org> | 2015-09-21 13:10:14 +0545 |
---|---|---|
committer | Phil Davis <phil.davis@inf.org> | 2015-09-21 13:10:14 +0545 |
commit | 29736edaf6890c898d4325b14a287614c43fe662 (patch) | |
tree | a1fcb500f213a5c1d67f0cb745b3da7a2c151029 /usr/local/www | |
parent | f70b256ed5d68d70b8fb22ac2e64b2797488394c (diff) | |
download | pfsense-29736edaf6890c898d4325b14a287614c43fe662.zip pfsense-29736edaf6890c898d4325b14a287614c43fe662.tar.gz |
Redmine #5162 do not allow alias rename to an existing name - RELENG_2_2
Diffstat (limited to 'usr/local/www')
-rwxr-xr-x | usr/local/www/firewall_aliases_edit.php | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/usr/local/www/firewall_aliases_edit.php b/usr/local/www/firewall_aliases_edit.php index ded7a85..2455d65 100755 --- a/usr/local/www/firewall_aliases_edit.php +++ b/usr/local/www/firewall_aliases_edit.php @@ -146,12 +146,10 @@ if ($_POST) { $input_errors[] = gettext("The alias name must be less than 32 characters long, may not consist of only numbers, and may only contain the following characters") . " a-z, A-Z, 0-9, _."; } /* check for name conflicts */ - if (empty($a_aliases[$id])) { - foreach ($a_aliases as $alias) { - if ($alias['name'] == $_POST['name']) { - $input_errors[] = gettext("An alias with this name already exists."); - break; - } + foreach ($a_aliases as $key => $alias) { + if (($alias['name'] == $_POST['name']) && (empty($a_aliases[$id]) || ($key != $id))) { + $input_errors[] = gettext("An alias with this name already exists."); + break; } } |