8000 [EmailValidator] Need to be upgraded · Issue #4930 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[EmailValidator] Need to be upgraded #4930

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

Closed
omgnull opened this issue Jul 15, 2012 · 4 comments
Closed

[EmailValidator] Need to be upgraded #4930

omgnull opened this issue Jul 15, 2012 · 4 comments

Comments

@omgnull
Copy link
omgnull commented Jul 15, 2012

Email address must to be forced thru punycode converter before filter_var validation. In example "инфо@письмо.рф" is a valid email address, but filter_var returns false.

$ php -r "var_dump(filter_var('инфо@письмо.рф', FILTER_VALIDATE_EMAIL));"

http://en.wikipedia.org/wiki/Punycode

@fabpot
Copy link
Member
fabpot commented Jul 15, 2012

Wouldn't it better if that was fixed upstream in PHP instead? Can you create a ticket on php.net?

@omgnull
Copy link
Author
omgnull commented Jul 15, 2012

The ticket exists since 2011-10-07 https://bugs.php.net/bug.php?id=55865.

@sstok
Copy link
Contributor
sstok commented Jul 16, 2012

Well as the validator accepts Punycode, the best possible way is extract the domain part.
Fast check for none ASCII and then pass that trough idn_to_ascii() (if its available http://php.net/manual/en/function.idn-to-ascii.php)

At least until its fixed upstream.

@egulias
Copy link
Contributor
egulias commented Dec 8, 2013

Solved by PR #9140

fabpot added a commit that referenced this issue Mar 27, 2014
…ncy (egulias)

This PR was squashed before being merged into the 2.5-dev branch (closes #9140).

Discussion
----------

[Validator][Email] - Strict validation and soft dependency

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | yes
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #1581, #4930
| License       | MIT
| Doc PR        | symfony/symfony-docs#3469

TODO
---------
- [x] submit changes to the documentation
- [x] document the BC breaks
- [x] finish the code
- [x] gather feedback for my changes

In #1581 @bschussek suggested to pass the strict_email config to  `Validator\EmailValidator::__construct($strict)`, I did not put it there yet since the constraint can receive that configuration each time the constraint is used despite the fact of the global configuration. This could lead to some logic in the constructor and I wanted first to integrate the strict validator.

BC Break
--------------
I'm not sure of this, but as a soft dependency is added and now some emails that where valid before no longer are I thought it is.

Commits
-------

3368630 #1581 - Strict in Email constraint and use of Egulias\EmailValidator
@fab
5B6E
pot fabpot closed this as completed Mar 27, 2014
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

4 participants
0