From ea64ec21acfdbc8867977dc135a24ea03a3133dc Mon Sep 17 00:00:00 2001 From: VVelox Date: Sun, 3 Jun 2018 04:29:06 -0500 Subject: [PATCH 1/2] a domain name is unlikely to be both a CNAME and A record --- src/Util/Network.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Util/Network.php b/src/Util/Network.php index c1ea6e354..2bc2203dd 100644 --- a/src/Util/Network.php +++ b/src/Util/Network.php @@ -492,7 +492,10 @@ class Network $h = substr($addr, strpos($addr, '@') + 1); - if (($h) && (dns_get_record($h, DNS_A + DNS_CNAME + DNS_MX) || filter_var($h, FILTER_VALIDATE_IP) )) { + if (($h) && (dns_get_record($h, DNS_A + DNS_MX) || filter_var($h, FILTER_VALIDATE_IP) )) { + return true; + } + if (($h) && (dns_get_record($h, DNS_CNAME + DNS_MX) || filter_var($h, FILTER_VALIDATE_IP) )) { return true; } return false; From 8875cc7419dae5d56c4d09e7d8321e5bfb1057c7 Mon Sep 17 00:00:00 2001 From: "Zane C. Bowers-Hadley" Date: Tue, 26 Jun 2018 05:03:45 -0500 Subject: [PATCH 2/2] remove duplicate check --- src/Util/Network.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Util/Network.php b/src/Util/Network.php index 2bc2203dd..c3ecaf606 100644 --- a/src/Util/Network.php +++ b/src/Util/Network.php @@ -495,7 +495,7 @@ class Network if (($h) && (dns_get_record($h, DNS_A + DNS_MX) || filter_var($h, FILTER_VALIDATE_IP) )) { return true; } - if (($h) && (dns_get_record($h, DNS_CNAME + DNS_MX) || filter_var($h, FILTER_VALIDATE_IP) )) { + if (($h) && dns_get_record($h, DNS_CNAME + DNS_MX)) { return true; } return false;