Closed jpkboca closed 9 years ago
This is a pretty big change to a pretty arcane hunk of code to be made without any explanation of why it's better. Why is it better?
I see, because of https://github.com/rjbs/Email-Valid/issues/11 !
Okay, I will have to write tests and stuff before merging this.
I'm not sure I see the real problem here. Email::Valid is based on RFC822, and parses accordingly. See http://www.w3.org/Protocols/rfc822/#z10
On the other hand, it handles stripping these comments already. The address
method returns the version without comments, so if Email::Valid is used properly, you won't end up with comments inside an address saved in a database. If you want to be quite strict, you can also compare the return value to the input.
I agree that it's sort of a mess, and I'd like to produce a better library, but right now I think it's better to use it as it works than to change its longstanding behavior.
Updated regular expression for rfc 822