Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email validation doesn't cover apostrophes #60

Closed
gfarrell opened this issue Apr 25, 2016 · 4 comments
Closed

Email validation doesn't cover apostrophes #60

gfarrell opened this issue Apr 25, 2016 · 4 comments

Comments

@gfarrell
Copy link
Contributor

Turns out (who knew?) that apostrophes are allowed in email addresses. Rather embarrassingly one of our customers was unable to login, I discovered that checkit invalidates an email address with an apostrophe in it 馃槩 .

@gfarrell
Copy link
Contributor Author

TBH I think the only really sane way of validating email addresses is (.+)@(.+), everything else is prone to failure, perhaps with one exception http://cubicspot.blogspot.co.uk/2012/06/correct-way-to-validate-e-mail-address.html

@rhys-vdw
Copy link
Collaborator

@gfarrell Well, (.+)@(.+) permit whitespace. I'd accept a PR with a similarly permissive check (but disallowing whitespace).

@gfarrell
Copy link
Contributor Author

馃憤

@gfarrell
Copy link
Contributor Author

Actually, @rhys-vdw, it looks like whitespace is permitted, with conditions, as per the Wikipedia article: https://en.wikipedia.org/wiki/Email_address#Local_part

The whole thing is further complicated by comments. I think that /^(.+)@(.+)$/ is probably the only sensible matcher in these circumstances.

I'll submit a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants