-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Extend email validation according to RFC 5322 #1969
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
Conversation
… by comma) as specified in RFC 5322, section 3.4.
You need to fix CS. Also you should allow to specify separator (not hardcode |
if ('' === $part) { | ||
$valid = false; | ||
} | ||
else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The else
should be on the same line than the closing curly brace (same for next places)
…ome explanatory comment.
I fixed the code to adhere to the coding convention, implemented the suggested trimming of the split values and added a separate error message for the case that the multiple option is set. |
I'm not convinced to be strict to RFC because I'm still rewriting |
@stloyd I thought about your comment once more and you got me convinced, so I made the separator configurable in the constraint as well (with the standard comma being the default). |
The email validator is just for the |
Make it possible to validate a list of email addresses as specified in RFC 5322, section 3.4 (i.e. have multiple email addresses separated by comma).