-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
[Url validator] Returns false for valid (and existing) url #32506
Comments
Can you resolve the url? https://stackoverflow.com/questions/2180465/can-domain-name-subdomains-have-an-underscore-in-it |
@Tobion what do you mean? The url i have provided is a string i want to validate, i have service that does collect alot of data by school-type facilities, and url (like one above) is one of properties i do collect. Everything is verified, and given url is valid, exists, and may be visited (GET to this url returns valid 200 HTTP response). All i need is to verify if given "string" is "url" (which should be done by Url validator, but is not in given case). Link from above shows that subdomain(s) with underscore (_) in their name are very common, however for those validator returns violation. |
There are several things to consider:
|
…e URL will load (battye) This PR was merged into the 3.4 branch. Discussion ---------- [Validator] Accept underscores in the URL validator, as the URL will load | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #32506 | License | MIT | Doc PR | - As @javiereguiluz mentioned, regardless of convention a URL with an underscore in it will load perfectly fine - so in that respect it must be valid. Commits ------- c9c7a11 [Validator] Accept underscores in the URL validator as the URL will resolve correctly
Symfony version(s) affected: 4.3.2 (propably earlier versions too)
Description
Url validator returns false (invalid url) on valid, and existing url - pattern issue
How to reproduce
Simply get an validator instance, and validate string/model with Url validator.
Url must contain underscores
_
(im amazed to see them in url tho)Possible Solution
Update pattern in validator :)
Additional context
The text was updated successfully, but these errors were encountered: