Fix #5778 do not save changes if interface description matches an alias name - RELENG_2_2

This commit is contained in:
Phil Davis 2016-01-18 21:49:32 +05:45
parent fdc515af33
commit b9abac57ec

View File

@ -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.");
}