assert icon indicating copy to clipboard operation
assert copied to clipboard

Unicode flag in email validation

Open gaelreyrol opened this issue 2 years ago • 1 comments

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:

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 avatar Aug 31 '23 07:08 gaelreyrol

@gaelreyrol yes, this seems like a bug we should fix.

shadowhand avatar Oct 15 '24 14:10 shadowhand