From d5b28fcf94d5db726f8e5d9e1e80662df215b733 Mon Sep 17 00:00:00 2001 From: Stephen Beaver Date: Wed, 25 Mar 2015 13:24:25 -0400 Subject: Fixes an issue wherein an alias could be added only if some other alias already exists in the system. --- usr/local/www/diag_dns.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'usr') diff --git a/usr/local/www/diag_dns.php b/usr/local/www/diag_dns.php index d99c5ba..cbce9aa 100644 --- a/usr/local/www/diag_dns.php +++ b/usr/local/www/diag_dns.php @@ -38,11 +38,13 @@ require("guiconfig.inc"); $host = trim($_REQUEST['host'], " \t\n\r\0\x0B[];\"'"); $host_esc = escapeshellarg($host); -if (is_array($config['aliases']['alias'])) { - $a_aliases = &$config['aliases']['alias']; -} else { - $a_aliases = array(); +/* If this section of config.xml has not been populated yet we need to set it up +*/ +if (!is_array($config['aliases']['alias'])) { + $config['aliases']['alias'] = array(); } +$a_aliases = &$config['aliases']['alias']; + $aliasname = str_replace(array(".","-"), "_", $host); $alias_exists = false; $counter=0; -- cgit v1.1