diff options
author | Renato Botelho <renato@netgate.com> | 2017-01-11 15:15:11 -0200 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2017-01-11 15:15:11 -0200 |
commit | 8c305c801373e0133fa847eb2ab89744b3028882 (patch) | |
tree | 8522c6af5569b3e4fb8977f225158cdc20cf35c6 /src/etc | |
parent | 983c4c6cc3c9cfa94c7a15a47c8607128be181d5 (diff) | |
download | pfsense-8c305c801373e0133fa847eb2ab89744b3028882.zip pfsense-8c305c801373e0133fa847eb2ab89744b3028882.tar.gz |
Simplify logic
Diffstat (limited to 'src/etc')
-rw-r--r-- | src/etc/inc/system.inc | 8 |
1 files 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") { |