From 8c305c801373e0133fa847eb2ab89744b3028882 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Wed, 11 Jan 2017 15:15:11 -0200 Subject: Simplify logic --- src/etc/inc/system.inc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/etc/inc/system.inc b/src/etc/inc/system.inc index b387814..c690188 100644 --- a/src/etc/inc/system.inc +++ b/src/etc/inc/system.inc @@ -386,14 +386,12 @@ function system_hosts_local_entries() { function system_hosts_override_entries($dnscfg) { $hosts = array(); - if (!is_array($dnscfg) || !isset($dnscfg['enable'])) { + if (!is_array($dnscfg) || + !is_array($dnscfg['hosts']) || + !isset($dnscfg['enable'])) { return $hosts; } - if (!is_array($dnscfg['hosts'])) { - $dnscfg['hosts'] = array(); - } - foreach ($dnscfg['hosts'] as $host) { $fqdn = ''; if ($host['host'] || $host['host'] == "0") { -- cgit v1.1