Joe McKie
Joe McKie

Reputation: 96

Why does the Symfony2 URL validator skip the TLD?

So, I'm developing a simple URL shortener in Symfony2 - one of the things that is required is the input must be a valid URL.

So I've set everything up and it's being validated, but it doesn't validate the TLD! It will pass things through such as "A" as being a valid domain!

What's going on?

Upvotes: 0

Views: 1088

Answers (1)

hakre
hakre

Reputation: 198204

You do not only want to validate the TLD, but also if the TLD is within the public suffix list:

Also please see a related question for a list of libraries: Get the subdomain from a URL

Upvotes: 4

Related Questions