Skip to content
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

Assertion::url validates invalid domain names #311

Open
p4veI opened this issue Jan 26, 2021 · 1 comment
Open

Assertion::url validates invalid domain names #311

p4veI opened this issue Jan 26, 2021 · 1 comment

Comments

@p4veI
Copy link

p4veI commented Jan 26, 2021

I've come across an issue where Assertion::url() method validates an invalid url.

I've passed http://whatever through this method without including a top level domain name e.g. .com etc. I feel like this is an invalid domain, however maybe I'm missing something as the pattern is quite extensive.

I've pasted the pattern here and included some examples, the first example I think should not pass the regex.

EDIT: I've also opened up an issue for symfony/validator as it seems the pattern from that library has been used here - so now I understand this passes so e.g. http://localhost can pass or some other internal urls on LAN, but just as I stated in comments there.. feels like this validation is completely useless while trying to validate for both. It's more useful for ipv4/ipv6 validation than actual urls with TLD host extensions.

@SeredOFF
Copy link

SeredOFF commented Jun 3, 2021

Also Assertion::url() method skips invalid hostnames:

  1. http://www.ex=ample.com - invalid characters,
  2. https://www.EXAMPLE.cOm - hostname must be in lowercase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants