Prevent a invalid argument on a empty array

This commit is contained in:
smos 2012-04-16 10:12:09 +02:00
parent c08a5659d8
commit 4b2bf4fc01

View File

@ -265,6 +265,8 @@ function system_hosts_generate() {
foreach ($dhcpifconf['staticmap'] as $host)
if ($host['ipaddr'] && $host['hostname'])
$dhosts .= "{$host['ipaddr']} {$host['hostname']}.{$syscfg['domain']} {$host['hostname']}\n";
}
if (isset($dnsmasqcfg['regdhcpstatic']) && is_array($config['dhcpdv6'])) {
foreach ($config['dhcpdv6'] as $dhcpif => $dhcpifconf)
if(is_array($dhcpifconf['staticmap']) && isset($dhcpifconf['enable']))
foreach ($dhcpifconf['staticmap'] as $host)