Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Validator] new email validation option to match with w3c official specification#47872

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@guillemfondin
Copy link
Contributor

@guillemfondinguillemfondin commentedOct 15, 2022
edited
Loading

QA
Branch?6.2
Bug fix?no
New feature?yes
Deprecations?no
TicketsFix#47712
LicenseMIT
Doc PRsymfony/symfony-docs#17360

WHAT

Email validator no matches with w3c official specication (that allow no tld) see#47712 for details.

WHY

In general, for public common usage, developers may not need to give users this liberty.
Except for specific use case, (internal email for eg) in companies...

HOW

Add an option for accept tld (already existEmail::VALIDATION_MODE_HTML5) or not (official specEmail::VALIDATION_MODE_HTML5_ALLOW_NO_TLD)

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has acontribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (seehttps://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (seehttps://symfony.com/releases)
  • Features and deprecations must be submitted against the 6.2 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@carsonbotcarsonbot changed the titleWIP: [Validator] Add new email validation option to match with w3c official specification[Validator] WIP: Add new email validation option to match with w3c official specificationOct 15, 2022
@guillemfondinguillemfondinforce-pushed thefeature/new-standard-email-validation branch fromb62971f to7cb0c02CompareOctober 15, 2022 13:31
@maxbeckers
Copy link
Contributor

@guillemfondin could you please add some unit tests for the change.

@guillemfondin
Copy link
ContributorAuthor

@maxbeckers Of course :)

@nicolas-grekasnicolas-grekas changed the title[Validator] WIP: Add new email validation option to match with w3c official specification[Validator] new email validation option to match with w3c official specificationOct 17, 2022
Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This approach makes sense to me. Accepting emails with no TLD by default would likely make more bad than good in practice. We'd better allow this in an opt-in way. The alternative could be to just do nothing BTW. The motivation for changes in Symfony should be based on real-world use cases.

@Sajito
Copy link

Weird having discussion in two seperate places, thanks@guillemfondin for notifying me :)

Personally I feel a bit uncomfortable with this change. Not because I need the ability to allow emails without a tld, actually I don't have an use-case for this feature. I have filed the issue only because during some tests I got to the point, where the browser validator said the email is fine, while the backend validator said it's invalid and that made me curious.

Having a validator, which claims it does the same check as the browser and is also named to represent this, but actually having a difference is weird. It get's even more weird, when the html5 mode (named after the html5 validator), does something different than the actual html5 validator and the "real" html5 validator has a name not even related to html5.

I'd say the naming should move to something like "html5" and "html5-force-tld". The only issue is the BC implication.
But changing this really feels hacky and I can understand, if that's not the way to go. I've pushed my proposal into my fork, just to make them visible.Commit is here.
Alternatively this new mode should make clear it's actually html5. Maybestrict-html5 or something like that.

Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I think this approach makes sense.

@fabpotfabpotforce-pushed thefeature/new-standard-email-validation branch fromd0da11d to23047d9CompareOctober 20, 2022 06:44
@fabpot
Copy link
Member

Thank you@guillemfondin.

guillemfondin reacted with laugh emoji

@fabpotfabpot merged commit43a56e8 intosymfony:6.2Oct 20, 2022
wouterj added a commit to symfony/symfony-docs that referenced this pull requestOct 23, 2022
…ndin)This PR was squashed before being merged into the 6.2 branch.Discussion----------[Validator] Email -  new `allow-no-tld` modeSee [Related feature PR](symfony/symfony#47872)As suggested [here](symfony/symfony#47712 (comment)) ; the actual description of `html5` mode isn't consistent with the one provided by browsers. Browsers allow no tld, `html5` mode not.I proprose to move the actual description of `html5` mode to the new `allow-no-tld` mode description, and clarify the subtlety (force .tld) of the actual `html5` mode.Commits-------485d57e [Validator] Email -  new `allow-no-tld` mode
@fabpotfabpot mentioned this pull requestOct 24, 2022
fabpot added a commit that referenced this pull requestMay 7, 2025
…ion modes can be configured (xabbuh)This PR was merged into the 6.4 branch.Discussion----------[FrameworkBundle] ensure that all supported e-mail validation modes can be configured| Q             | A| ------------- | ---| Branch?       | 6.4| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Issues        |Fix#60352| License       | MITthis update was forgotten when adding the `html5-allow-no-tld` e-mail validation mode in#47872Commits-------b8b3c37 ensure that all supported e-mail validation modes can be configured
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof left review comments

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@welcoMatticwelcoMatticwelcoMattic approved these changes

+1 more reviewer

@PhilETaylorPhilETaylorPhilETaylor left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

6.2

Development

Successfully merging this pull request may close these issues.

[Validator] EmailValidator in html5 mode does not match actual html validator

9 participants

@guillemfondin@carsonbot@maxbeckers@Sajito@fabpot@nicolas-grekas@PhilETaylor@stof@welcoMattic

[8]ページ先頭

©2009-2025 Movatter.jp