Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Validator] deprecate the loose e-mail validation mode #46518

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

Merged
merged 1 commit into from
Jun 2, 2022

Conversation

xabbuh
Copy link
Member

@xabbuh xabbuh commented May 31, 2022

Q A
Branch? 6.2
Bug fix? no
New feature? no
Deprecations? yes
Tickets Fix #41855
License MIT
Doc PR

@fabpot
Copy link
Member

fabpot commented Jun 2, 2022

Thank you @xabbuh.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

@xabbuh i know the code is already merged but maybe you can have a look at my comments?

@@ -68,6 +71,10 @@ public function __construct(
$this->mode = $mode ?? $this->mode;
$this->normalizer = $normalizer ?? $this->normalizer;

if (self::VALIDATION_MODE_LOOSE === $this->mode) {
trigger_deprecation('symfony/validator', '6.2', 'The "%s" mode is deprecated. The default mode will be changed to "%s" in 7.0.', self::VALIDATION_MODE_LOOSE, self::VALIDATION_MODE_HTML5);
Copy link

Choose a reason for hiding this comment

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

Will the default be changed or will the validation mode be removed?

@@ -27,6 +27,9 @@ class Email extends Constraint
{
public const VALIDATION_MODE_HTML5 = 'html5';
public const VALIDATION_MODE_STRICT = 'strict';
/**
* @deprecated since Symfony 6.2
Copy link

Choose a reason for hiding this comment

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

@deprecated since Symfony 6.2, use VALIDATION_MODE_HTML5 instead?

@xabbuh
Copy link
Member Author

xabbuh commented Feb 17, 2023

@johanadivare sorry for the late feedback, please see #49420

fabpot added a commit that referenced this pull request Feb 20, 2023
This PR was merged into the 6.2 branch.

Discussion
----------

improve deprecation message

| Q             | A
| ------------- | ---
| Branch?       | 6.2
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | #46518 (comment) and #46518 (comment)
| License       | MIT
| Doc PR        |

Commits
-------

54a1d1b improve deprecation message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Validator] Change default mode of Assert\Email to "strict", for consistency with Mailer
5 participants