Home » Validate » Validate » Bug #4246
Validate::uri doesn't check url
Details
| Request #4246 | Validate::uri doesn't check url |
|---|---|
| Submitted | 2005-04-29 12:45 UTC |
| From | rick at ninjafoo dot com |
| Status | Bogus |
| Package | Validate |
| PHP Version | 4.3.11 |
| OS | Gentoo |
| Roadmaps | (Not assigned) |
Comments
[2005-04-29 12:45 UTC] rick at ninjafoo dot com
Description:
------------
If your DNS service is incorrectly matching none existant domains (like mine is), validate::uri will return true for "http://a"
(Not that Im asking you to fix our DNS)
How about adding the option to check the uri string (something like the following)
preg_match("/^(http(s?):\\/\\/|ftp:\\/\\/{1})((\w+\.)+)\w{2,}(\/?)$/i", $url)
[2005-04-29 17:57 UTC] rick at ninjafoo dot com
I understand that this is not a bug, and that a URL is not
a URI.
My suggestion was that having an optional URL check withen
the same
function would be useful.