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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EmailValidator allows 'é' 'è' #21583

Closed
FabienPapet opened this issue Feb 10, 2017 · 1 comment
Closed

EmailValidator allows 'é' 'è' #21583

FabienPapet opened this issue Feb 10, 2017 · 1 comment

Comments

@FabienPapet
Copy link

FabienPapet commented Feb 10, 2017

Q A
Bug report? yes
Feature request? yes ?
BC Break report? maybe?
RFC? yes
Symfony version 3.2 (also on 2.7)

Maybe it is a bug, or this is expected behavior, but éàé@local.dev seems to be a valid email (with strict_mode off, default behavior)

The problem is when you want to send an email with this address, there is an Exception raised by swiftmailer because this email is not RFC822 compliant .

Shouldn't we use the the filter_var('éàé@local.dev', FILTER_VALIDATE_EMAIL) which follows RFC 822 instead of a regex here ?

@xabbuh
Copy link
Member

xabbuh commented Feb 10, 2017

That's the expected behaviour. If you need to catch more invalid e-mail addresses, you need use the strict option. filter_var() was used in the past, but it had other issues. If you want to read more about this, you can take a look at these issues (there are probably more about this topic): #18162, #18560, #19385 and #20309

In #1581 you can read more about the discussion that led to the introduction of the strict option and dropping the use of filter_var() (see PR this features was introduced with is #9140).

Since there is no bug in the component I am closing here. Thank you for understanding.

@xabbuh xabbuh closed this as completed Feb 10, 2017
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