Fixes ACCOUNTS-5Y5. Also idna escape login part of the email.

This commit is contained in:
ErickSkrauch
2019-12-15 18:13:47 +03:00
parent 3d89e5f94d
commit 3b00e36816
2 changed files with 12 additions and 7 deletions

View File

@@ -40,7 +40,7 @@ class EmailValidator extends Validator {
$idnaDomain = new validators\FilterValidator(['filter' => function(string $value): string {
[$name, $domain] = explode('@', $value);
return $name . '@' . idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46);
return idn_to_ascii($name, 0, INTL_IDNA_VARIANT_UTS46) . '@' . idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46);
}]);
$unique = new validators\UniqueValidator();