Skip to content

Commit

Permalink
DNS check should convert unicode domains first (#166)
Browse files Browse the repository at this point in the history
* fix checkdnsrr not handling unicode domains properly

* fix for php7.2
  • Loading branch information
lode authored and egulias committed Apr 10, 2018
1 parent 114b663 commit 8790f59
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion EmailValidator/Validation/DNSCheckValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function getWarnings()

protected function checkDNS($host)
{
$host = rtrim($host, '.') . '.';
$host = rtrim(idn_to_ascii($host, IDNA_DEFAULT, INTL_IDNA_VARIANT_UTS46), '.') . '.';

This comment has been minimized.

Copy link
@1ed

1ed Jun 19, 2018

This is a BC break :( as it requires (PHP 5 >= 5.3.0, PHP 7, PECL intl >= 1.0.2, PECL idn >= 0.1) and it is not reflected in the composer json.


$Aresult = true;
$MXresult = checkdnsrr($host, 'MX');
Expand Down
3 changes: 3 additions & 0 deletions Tests/EmailValidator/Validation/DNSCheckValidationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ public function validEmailsProvider()
['"Abc@def"@example.com'],
['"Fred\ Bloggs"@example.com'],
['"Joe.\\Blow"@example.com'],

// unicide
['ñandu.cl'],
];
}

Expand Down

0 comments on commit 8790f59

Please sign in to comment.