Use global aliastable and proper fix #2941

This commit is contained in:
Renato Botelho 2013-05-23 08:05:00 -03:00
parent 1546aaf0ea
commit f0867239c1

View File

@ -84,6 +84,8 @@ if (isset($_GET['dup']))
if ($_POST) {
global $aliastable;
unset($input_errors);
$pconfig = $_POST;
@ -126,8 +128,8 @@ if ($_POST) {
} elseif (is_alias($_POST['network'])) {
$osn = $_POST['network'];
$fqdn_found = 0;
foreach (filter_expand_alias_array($_POST['network'], true) as $tgt) {
if (!is_ipaddr($tgt) && is_hostname($tgt)) {
foreach (preg_split('/\s+/', $aliastable[$osn]) as $tgt) {
if (!is_ipaddr($tgt)) {
if ($fqdn_found === 0) {
$input_errors[] = sprintf(gettext("The alias (%s) has one or more FQDNs configured and cannot be used to configure a static route."), $_POST['network']);
$fqdn_found = 1;