PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

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.