From 7b2eccb6ade49263fd1189e9a3b326fd070099bf Mon Sep 17 00:00:00 2001 From: Chris Buechler Date: Fri, 20 Jun 2008 17:51:44 +0000 Subject: fix bug if no aliases exist Ticket #1760 --- usr/local/www/interfaces_opt.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'usr/local/www/interfaces_opt.php') diff --git a/usr/local/www/interfaces_opt.php b/usr/local/www/interfaces_opt.php index 750411d..b043948 100755 --- a/usr/local/www/interfaces_opt.php +++ b/usr/local/www/interfaces_opt.php @@ -58,9 +58,10 @@ $optcfg['descr'] = remove_bad_chars($optcfg['descr']); if (!is_array($config['aliases']['alias'])) $config['aliases']['alias'] = array(); -foreach($config['aliases']['alias'] as $alias) - if($alias['name'] == $optcfg['descr']) - $input_errors[] = gettext("Sorry, an alias with the name {$optcfg['descr']} already exists."); +if(is_array($config['aliases']['alias'])) + foreach($config['aliases']['alias'] as $alias) + if($alias['name'] == $optcfg['descr']) + $input_errors[] = gettext("Sorry, an alias with the name {$optcfg['descr']} already exists."); $pconfig['descr'] = $optcfg['descr']; $pconfig['bridge'] = $optcfg['bridge']; -- cgit v1.1