mirror of
https://github.com/egulias/EmailValidator.git
synced 2026-11-25 21:42:23 +00:00
DNS record check now passes if email address has no top-level domain (#355)
This commit is contained in:
@@ -123,9 +123,20 @@ class DNSCheckValidation implements EmailValidation
|
||||
{
|
||||
$variant = INTL_IDNA_VARIANT_UTS46;
|
||||
|
||||
$host = rtrim(idn_to_ascii($host, IDNA_DEFAULT, $variant), '.') . '.';
|
||||
$host = rtrim(idn_to_ascii($host, IDNA_DEFAULT, $variant), '.');
|
||||
|
||||
return $this->validateDnsRecords($host);
|
||||
$hostParts = explode('.', $host);
|
||||
$host = array_pop($hostParts);
|
||||
|
||||
while (count($hostParts) > 0) {
|
||||
$host = array_pop($hostParts) . '.' . $host;
|
||||
|
||||
if ($this->validateDnsRecords($host)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user