Validate package - url/uri problems
| From: | Galloway Web Design | Date: | Fri, 25 Jan 2008 16:19:22 +0000 |
| Subject: | Validate package - url/uri problems | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-28467@lists.php.net to get a copy of this message | ||
I am using the pear Validate package in order to validate any urls submitted through my website, however, it doesn't seem to be behaving the way it should - all urls without 'http://' at the start will validate false and even more annoyingly, all urls that do start with 'http://' validate true! This means 'www.example.com' is false and 'http://example.blobbyblobexecutescript.hopalong' is true! Surely this can't be right? What am I dong wrong?
The line of code I am using is:
if (!Validate::uri($url)) {
echo'url invalid';
}
Thanks,
Mike.