PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Validate » Validate » Bug #4246

Validate::uri doesn't check url

Details

Request #4246Validate::uri doesn't check url
Submitted2005-04-29 12:45 UTC
Fromrick at ninjafoo dot com
StatusBogus
PackageValidate
PHP Version4.3.11
OSGentoo
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.