h
This commit is contained in:
parent
5abe3ae4b2
commit
1769de4cdc
@ -1682,19 +1682,19 @@
|
|||||||
if(!$config['dns_system']) {
|
if(!$config['dns_system']) {
|
||||||
$ip_addr = gethostbyname($host);
|
$ip_addr = gethostbyname($host);
|
||||||
if($ip_addr == $host)
|
if($ip_addr == $host)
|
||||||
return false;
|
$ip_addr = false;
|
||||||
} else {
|
} else {
|
||||||
$resp = shell_exec('host -W 1 ' . $host);
|
$resp = shell_exec('host -W 1 ' . $host);
|
||||||
if(preg_match('/has address ([^\s]+)$/', $resp, $m))
|
if(preg_match('/has address ([^\s]+)$/', $resp, $m))
|
||||||
$ip_addr = $m[1];
|
$ip_addr = $m[1];
|
||||||
else
|
else
|
||||||
return false;
|
$ip_addr = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($config['cache']['enabled'])
|
if($config['cache']['enabled'])
|
||||||
cache::set('dns_' . $host, $ip_addr, 3600);
|
cache::set('dns_' . $host, $ip_addr, 3600);
|
||||||
|
|
||||||
return $host;
|
return $ip_addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user