assert
assert copied to clipboard
Unicode flag in email validation
Hi,
I noticed that the assertion made by Assertion::email() does not allow Unicode characters. Since 2012, Unicode characters above U+007F encoded as UTF-8 are allowed in the local part.
PHP 7.1 added the flag FILTER_FLAG_EMAIL_UNICODE that can be used with FILTER_VALIDATE_EMAIL to accept those Unicode characters.
filter_var($value, FILTER_VALIDATE_EMAIL, FILTER_FLAG_EMAIL_UNICODE)
A simple test with two emails allows to check the difference:
[email protected]föö@bar.com
I can submit a PR to add the flag with an extra argument but maybe you would prefer to add a new method so I prefer to discuss it here before.
Regards
@gaelreyrol yes, this seems like a bug we should fix.