mirror of
https://github.com/vlucas/valitron.git
synced 2025-12-30 23:01:52 +00:00
Added idn_to_ascii() with a check to make sure the function itself exists as well as a check for a required constant that it needs to function.
This commit is contained in:
parent
28ef275cde
commit
8603b2bec3
@ -511,6 +511,9 @@ class Validator
|
|||||||
{
|
{
|
||||||
if ($this->validateEmail($field, $value)) {
|
if ($this->validateEmail($field, $value)) {
|
||||||
$domain = ltrim(stristr($value, '@'), '@') . '.';
|
$domain = ltrim(stristr($value, '@'), '@') . '.';
|
||||||
|
if (function_exists('idn_to_ascii') && defined('INTL_IDNA_VARIANT_UTS46')) {
|
||||||
|
$domain = idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46);
|
||||||
|
}
|
||||||
return checkdnsrr($domain, 'ANY');
|
return checkdnsrr($domain, 'ANY');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user