DNS check should convert unicode domains first (#166)

* fix checkdnsrr not handling unicode domains properly

* fix for php7.2
This commit is contained in:
Lode Claassen
2018-04-10 12:11:19 +02:00
committed by Eduardo Gulias Davis
parent 114b663f20
commit 8790f59415
2 changed files with 4 additions and 1 deletions
@@ -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'],
];
}