gajus / vlad

Input validation library promoting succinct syntax with extendable validators and multilingual support.
Other
104 stars 8 forks source link

[RFC] - Improve email validation #7

Open egulias opened 10 years ago

egulias commented 10 years ago

Hi! The Email validator is curretnly ussing php built-in filter_var. As you may know it allows for false negatives on emails like name@localhost. Would you consider integrating https://github.com/egulias/EmailValidator for the validation? It has been added as a (soft)dependency in Symfony (https://github.com/symfony/symfony/pull/9140). Swiftmailer is considering it to. Thanks!

gajus commented 10 years ago

"name@localhost" is a valid email address. What do you mean by false-positive?

On Apr 11, 2014, at 9:00, Eduardo Gulias Davis notifications@github.com wrote:

Hi! The Email validator is curretnly ussing php built-in filter_var. As you may know it allows for false negatives on emails like name@localhost. Would you consider integrating https://github.com/egulias/EmailValidator for the validation? It has been added as a (soft)dependency in Symfony (symfony/symfony#9140). Swiftmailer is considering it to. Thanks!

— Reply to this email directly or view it on GitHub.

egulias commented 10 years ago

by false negative I mean that filter_var will say email@localhost is invalid.

gajus commented 10 years ago

I hame misunderstood you.

var_dump(filter_var('email@localhost', FILTER_VALIDATE_EMAIL));

Yes, that's not right. I will consider https://github.com/egulias/EmailValidator as well as the alternatives.

egulias commented 10 years ago

Great! Thanks. If you find an alternative, let me know so I can check it too.