mirror of
https://github.com/egulias/EmailValidator.git
synced 2026-09-15 12:36:38 +00:00
Fix #260 reporting an unhandled exception
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user