quick tidy up of dnslookup function #5633 (#5639)

This commit is contained in:
Neil Lathwood 2017-01-28 00:02:39 +00:00 committed by GitHub
parent dda3bb0995
commit 86445befde

View File

@ -1513,7 +1513,7 @@ function oxidized_reload_nodes()
function dnslookup($device, $type = false, $return = false)
{
if (filter_var($device['hostname'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) == true || filter_var($device['hostname'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) == true) {
return '';
return false;
}
if (empty($type)) {
// We are going to use the transport to work out the record type
@ -1526,7 +1526,7 @@ function dnslookup($device, $type = false, $return = false)
}
}
if (empty($return)) {
return '';
return false;
}
$record = dns_get_record($device['hostname'], $type);
return $record[0][$return];