-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] Simplify the Email Validator #18177
Comments
IMO, the |
👍 but we should take care of BC breaks, that's the difficult part... |
Hi there.
That being said, of course HTML5 one will be "valid" for more of the cases. But, just as an example, that RegExp is saying that [update] By the way, during the addition of the library, even the use of However I do think that replacing the "non strict" with HTML5 regexp will be more useful than the one currently in use. |
Just my 2 cents. Use filter_var for the simple case and fix it upstream if applicable. |
I personally think checkMX and checkHost should be kept as well. |
@dunglas fixing it upstream would take years to have a working validation with widespread adoption though (assuming we manage to make upstream change the validation rules of filter_var). And such changes would probably not even be backported to patch releases of previous PHP versions |
Please DO NOT try to filter email addresses. The only thing that would be good is to provide an interface to let the developer choose how to filter email addresses. Similar discussion in FOSUserBundle: FriendsOfSymfony/FOSUserBundle#1923 Additionally we should add a warning on the documentation of Symfony about email address filtering and explain why it is complex. Email validation is not recommended: A valid regex for only one RFC (RFC 822) is crazy. And there are a lot more RFCs for valid email addresses. http://stackoverflow.com/a/13719870 |
Closing it because of the lack of recent activity and because it hasn't attracted enough attention from the community. |
Problem
Solution
HTML5 Standard proposes this regexp to validate emails:
Proposal
strict
optioncheckMX
optioncheckHost
optionThe text was updated successfully, but these errors were encountered: