-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
[Validator] Add a requireTld
option to Url
constraint
#54408
Conversation
src/Symfony/Component/Validator/Tests/Constraints/UrlValidatorTest.php
Outdated
Show resolved
Hide resolved
we need an entry in the Validator component's changelog file |
I've added the changelog entry. Thanks! |
requireTld
option to Url
constraint
Thank you @javiereguiluz. |
) { | ||
parent::__construct($options, $groups, $payload); | ||
|
||
$this->message = $message ?? $this->message; | ||
$this->protocols = $protocols ?? $this->protocols; | ||
$this->relativeProtocol = $relativeProtocol ?? $this->relativeProtocol; | ||
$this->normalizer = $normalizer ?? $this->normalizer; | ||
$this->requireTld = $requireTld ?? $this->requireTld; |
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.
In the issue, we discussed deprecating not setting this, so we can change the default to true
(which is in sync with the Hostname
constraint's requireTld
option).
Do we still want to do this?
If we don't, I would say we change the default of the parameter to false
instead (I see no point making it nullable?)
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.
see #54588
This implements the last part of #50871 following the suggestions from Wouter and Christian in
#50871 (comment)