Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Validator] Deprecated "checkDNS" option in Url constraint#25516
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| thrownewInvalidOptionsException(sprintf('Invalid value for option "checkDNS" in constraint %s',get_class($constraint)),array('checkDNS')); | ||
| } | ||
| @trigger_error(sprintf('The "checkDNS" option in "%s" is deprecated since 4.1 and will be removed in 5.0.', Url::class),E_USER_DEPRECATED); |
nicolas-grekasDec 18, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
sinceversion 4.1
I'm wondering: should we add a few words why? like eg
The "checkDNS" option in "%s" is deprecated since 4.1 and will be removed in 5.0. It's too fragile to be relied upon.
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.
the notice should be before the above "if", isn't it?
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.
Not sure if this is too fragile, but the false positive rate is so high that it's not reliable. I think reliable is perhaps better.
| } | ||
| if ($constraint->checkDNS) { | ||
| @trigger_error(sprintf('The "checkDNS" option in "%s" is deprecated since version 4.1 and will be removed in 5.0. Its false positive rate is too high to be relied upon.', Url::class),E_USER_DEPRECATED); |
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.
I would just suggest a dash: false-positive
UPGRADE-4.1.md Outdated
| * The`Email::__construct()` 'strict' property is deprecated and will be removed in 5.0. Use 'mode'=>"strict" instead. | ||
| * Calling`EmailValidator::__construct()` method with a boolean parameter is deprecated and will be removed in 5.0, use`EmailValidator("strict")` instead. | ||
| * Deprecated`checkDNS` option in`Url` constraint. It will be removed in 5.0. |
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.
Deprecated thecheckDNS option in theUrl [...]
UPGRADE-5.0.md Outdated
| * The`Email::__construct()` 'strict' property has been removed. Use 'mode'=>"strict" instead. | ||
| * Calling`EmailValidator::__construct()` method with a boolean parameter has been removed, use`EmailValidator("strict")` instead. | ||
| * Removed`checkDNS` option in`Url` constraint. |
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.
Removed thecheckDNS option from theUrl constraint.
| 4.1.0 | ||
| ----- | ||
| * Deprecated`checkDNS` option in`Url` constraint. It will be removed in 5.0. |
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.
Deprecated thecheckDNS option in theUrl [...]
| class Urlextends Constraint | ||
| { | ||
| /** | ||
| * @deprecated since version 4.1, to be removed in 5.0 |
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.
since Symfony 4.1 (see#25565)
ro0NL commentedDec 22, 2017
Forgot to deprecate |
xabbuh commentedDec 22, 2017
As people may forgot to not use the |
ro0NL commentedDec 23, 2017
Deprecation now moved to constraint constructor. |
UPGRADE-4.1.md Outdated
| * The`Email::__construct()` 'strict' property is deprecated and will be removed in 5.0. Use 'mode'=>"strict" instead. | ||
| * Calling`EmailValidator::__construct()` method with a boolean parameter is deprecated and will be removed in 5.0, use`EmailValidator("strict")` instead. | ||
| * Deprecated the`checkDNS` and`dnsMessage` options in the`Url` constraint. They will be removed in 5.0. |
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.
[...] options of the [...]
UPGRADE-5.0.md Outdated
| * The`Email::__construct()` 'strict' property has been removed. Use 'mode'=>"strict" instead. | ||
| * Calling`EmailValidator::__construct()` method with a boolean parameter has been removed, use`EmailValidator("strict")` instead. | ||
| * Removed the`checkDNS` and`dnsMessage` options in the`Url` constraint. |
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.
[...] options from the [...]
| 4.1.0 | ||
| ----- | ||
| * Deprecated the`checkDNS` and`dnsMessage` options in the`Url` constraint. They will be removed in 5.0. |
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.
[...] options of the [...]
fabpot commentedDec 31, 2017
Thank you@ro0NL. |
iisisrael commentedAug 17, 2018
I'm actually sad to see this go. Adding the functionality back into our project as a customized extension was not difficult, but I think it odd that there was so little discussion around the deprecation. If the underlying functionality is deemed inconclusive because of false positives, that's something that should be understood by the consuming application. We know that, and use this functionality as just one piece of a greater validation strategy. Having it as an option was just that, an option. |
iisisrael commentedAug 17, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Also, the same functionality continues to exist undeprecated as the |
This PR was merged into the 5.0-dev branch.Discussion----------[Validator] Remove checkDNS option in Url| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | no| BC breaks? | no <!-- seehttps://symfony.com/bc -->| Deprecations? | no| Tests pass? | yes <!-- please add some, will be required by reviewers -->| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->| License | MIT| Doc PR | symfony/symfony-docs#... <!-- required for new features -->See#25516Commits-------885703f [Validator] Remove checkDNS option in Url
Uh oh!
There was an error while loading.Please reload this page.