-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[Validator] Html5 Email Validation #8487
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
Conversation
This PR was merged into the 4.1-dev branch. Discussion ---------- [Validator] Html5 Email Validation Currently we only support a very loose validation. There is now a standard HTML5 element with matching regex. This will add the ability to set a `mode` on the email validator. The mode will change the validation that is applied to the field as a whole. These modes are: * loose: The pattern from previous Symfony versions (default) * strict: Strictly matching the RFC * html5: The regex used for the HTML5 Element Deprecates the `strict=true` parameter in favour of `mode='strict'` | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | #21531 | License | MIT | Doc PR | symfony/symfony-docs#8487 <!-- - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the 3.4, legacy code removals go to the master branch. - Please fill in this template according to the PR you're about to submit. - Replace this comment by a description of what your PR is solving. --> Commits ------- cf04108 [Validator] Html5 Email Validation
I've rebased this off master, as eventually the PR went into the 4.1 branch (which is currently master). I'd love get this reviewed now that that's merged in. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great. I have just left a few minor comments. Thanks for creating the feature and writing the documentation for it.
Add documentation about the new mode parameter. Adds descriptions for the 'loose', 'strict', and 'html5' options.
Thank you @PurpleBooth. |
This PR was merged into the master branch. Discussion ---------- [Validator] Html5 Email Validation Add documentation about the new mode parameter. Adds descriptions for the 'loose', 'strict', and 'html5' options. Relates to symfony/symfony#24442 Commits ------- 07d4bf9 [Validator] Html5 Email Validation
@@ -7,7 +7,7 @@ cast to a string before being validated. | |||
+----------------+---------------------------------------------------------------------+ | |||
| Applies to | :ref:`property or method <validation-property-target>` | | |||
+----------------+---------------------------------------------------------------------+ | |||
| Options | - `strict`_ | | |||
| Options | - `mode`_ | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the strict
option have been annotated as "deprecated in Symfony 4.1" rather than completely replaced?
Add documentation about the new mode parameter. Adds descriptions for
the 'loose', 'strict', and 'html5' options.
Relates to symfony/symfony#24442