mirror of
https://github.com/egulias/EmailValidator.git
synced 2026-09-10 01:56:30 +00:00
DNS check should convert unicode domains first (#166)
* fix checkdnsrr not handling unicode domains properly * fix for php7.2
This commit is contained in:
committed by
Eduardo Gulias Davis
parent
114b663f20
commit
8790f59415
@@ -44,7 +44,7 @@ class DNSCheckValidation implements EmailValidation
|
||||
|
||||
protected function checkDNS($host)
|
||||
{
|
||||
$host = rtrim($host, '.') . '.';
|
||||
$host = rtrim(idn_to_ascii($host, IDNA_DEFAULT, INTL_IDNA_VARIANT_UTS46), '.') . '.';
|
||||
|
||||
$Aresult = true;
|
||||
$MXresult = checkdnsrr($host, 'MX');
|
||||
|
||||
@@ -24,6 +24,9 @@ class DNSCheckValidationTest extends TestCase
|
||||
['"Abc@def"@example.com'],
|
||||
['"Fred\ Bloggs"@example.com'],
|
||||
['"Joe.\\Blow"@example.com'],
|
||||
|
||||
// unicide
|
||||
['ñandu.cl'],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user