alternate fix for z_check_dns
This commit is contained in:
parent
afb29176a4
commit
cd4454100b
@ -468,13 +468,21 @@ function z_dns_check($h,$check_mx = 0) {
|
|||||||
&& \App::$config['system']['do_not_check_dns'])
|
&& \App::$config['system']['do_not_check_dns'])
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
// This will match either Windows or Mac ('Darwin')
|
||||||
|
if(stripos(PHP_OS,'win') !== false)
|
||||||
|
return true;
|
||||||
|
|
||||||
//$opts = DNS_A + DNS_CNAME + DNS_PTR;
|
// BSD variants have dns_get_record() but it only works reliably without any options
|
||||||
//if($check_mx)
|
if(stripos(PHP_OS,'bsd') !== false)
|
||||||
// $opts += DNS_MX;
|
return((@dns_get_record($h) || filter_var($h, FILTER_VALIDATE_IP)) ? true : false);
|
||||||
// Specific record type flags are unreliable on FreeBSD and Mac,
|
|
||||||
// so now we'll ignore these and just check for the existence of any DNS record.
|
// Otherwise we will assume dns_get_record() works as documented
|
||||||
return((@dns_get_record($h) || filter_var($h, FILTER_VALIDATE_IP)) ? true : false);
|
|
||||||
|
$opts = DNS_A + DNS_CNAME + DNS_PTR;
|
||||||
|
if($check_mx)
|
||||||
|
$opts += DNS_MX;
|
||||||
|
|
||||||
|
return((@dns_get_record($h,$opts) || filter_var($h, FILTER_VALIDATE_IP)) ? true : false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user