diff options
author | Andrew Manning <tamanning@zoho.com> | 2018-05-25 20:07:31 -0400 |
---|---|---|
committer | Andrew Manning <tamanning@zoho.com> | 2018-05-25 20:07:31 -0400 |
commit | ed17e8a6499e48b032393be351c39f31a0edcbf3 (patch) | |
tree | 42c00549dba641bc7c8e6547fc2ef131bdd60cd6 /include | |
parent | fc6b337bbbd2fd3b5412c8b957122830f73feb2d (diff) | |
parent | 33700e9cf47e2b5f0b4597772d9cea81e811bae3 (diff) | |
download | volse-hubzilla-ed17e8a6499e48b032393be351c39f31a0edcbf3.tar.gz volse-hubzilla-ed17e8a6499e48b032393be351c39f31a0edcbf3.tar.bz2 volse-hubzilla-ed17e8a6499e48b032393be351c39f31a0edcbf3.zip |
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev
Diffstat (limited to 'include')
-rw-r--r-- | include/network.php | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/include/network.php b/include/network.php index 7e8f823a3..4b2d2f93f 100644 --- a/include/network.php +++ b/include/network.php @@ -468,13 +468,21 @@ function z_dns_check($h,$check_mx = 0) { && \App::$config['system']['do_not_check_dns']) return true; + // This will match either Windows or Mac ('Darwin') + if(stripos(PHP_OS,'win') !== false) + return true; + + // BSD variants have dns_get_record() but it only works reliably without any options + if(stripos(PHP_OS,'bsd') !== false) + return((@dns_get_record($h) || filter_var($h, FILTER_VALIDATE_IP)) ? true : false); + + // Otherwise we will assume dns_get_record() works as documented + + $opts = DNS_A + DNS_CNAME + DNS_PTR; + if($check_mx) + $opts += DNS_MX; - //$opts = DNS_A + DNS_CNAME + DNS_PTR; - //if($check_mx) - // $opts += DNS_MX; - // 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. - return((@dns_get_record($h) || filter_var($h, FILTER_VALIDATE_IP)) ? true : false); + return((@dns_get_record($h,$opts) || filter_var($h, FILTER_VALIDATE_IP)) ? true : false); } /** |