Description of problem:
I want to validate urls serversideusing code like this:
Field::inst( 'NameOfField' )
->validator( Validate::url(
ValidateOptions::inst()
->message( 'ErrorMessage' )
) )
With this I encounter several oddities: in my tests
- http://bremen.de => validates ok => correct
- https://bremen.de => validates ok => correct
- bremen.de => validates not ok => correct
- http:bremen.de => validates not ok => correct
- htt://bremen.de => validates ok => not correct ?
- http://bremen => validates ok => not correct ?
What do I do wrong?
Or is this behaviour intentional? I read you are using a library (https://www.npmjs.com/package/valid-url/v/1.0.3), and they say it validates "relatively 'real-world' " ...
As a workaround I did some experiments with 'pinging' the adresses, which works, but not solid rock - so it would be very nice if someone could help me out.