diff options
author | Phil Davis <phil.davis@inf.org> | 2016-01-18 21:49:32 +0545 |
---|---|---|
committer | Phil Davis <phil.davis@inf.org> | 2016-01-18 21:49:32 +0545 |
commit | b9abac57ece83c4baeedfcd470dcab1084f98ae6 (patch) | |
tree | 22a8c0a317ec3ea08558945cb87642ddf5ca6420 | |
parent | fdc515af3361bd0371f236557fa018b41d61578c (diff) | |
download | pfsense-b9abac57ece83c4baeedfcd470dcab1084f98ae6.zip pfsense-b9abac57ece83c4baeedfcd470dcab1084f98ae6.tar.gz |
Fix #5778 do not save changes if interface description matches an alias name - RELENG_2_2
-rw-r--r-- | usr/local/www/interfaces.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php index 7184dee..baf59af 100644 --- a/usr/local/www/interfaces.php +++ b/usr/local/www/interfaces.php @@ -504,6 +504,16 @@ if ($_POST['apply']) { break; } } + + /* 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']) { + $input_errors[] = sprintf(gettext("Sorry, an alias with the name %s already exists."), $_POST['descr']); + } + } + } + if(is_numeric($_POST['descr'])) { $input_errors[] = gettext("The interface description cannot contain only numbers."); } |