Fix #260 reporting an unhandled exception

This commit is contained in:
Eduardo Gulias Davis
2020-09-06 15:17:48 +02:00
parent e2e234c4d8
commit 3647ed6037
+2 -2
View File
@@ -118,11 +118,11 @@ class DNSCheckValidation implements EmailValidation
private function validateDnsRecords($host)
{
// Get all MX, A and AAAA DNS records for host
$dnsRecords = dns_get_record($host, DNS_MX + DNS_A + DNS_AAAA);
$dnsRecords = @dns_get_record($host, DNS_MX + DNS_A + DNS_AAAA);
// No MX, A or AAAA DNS records
if (empty($dnsRecords)) {
if (empty($dnsRecords) || !$dnsRecords) {
$this->error = new InvalidEmail(new ReasonNoDNSRecord(), '');
return false;
}