#49197 [Bgs]: FILTER_VALIDATE_URL does not validate urls
| From: | matt dot farina at gmail dot com | Date: | Sun, 09 Aug 2009 17:21:45 +0000 |
| Subject: | #49197 [Bgs]: FILTER_VALIDATE_URL does not validate urls | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-140831@lists.php.net to get a copy of this message | ||
ID: 49197
User updated by: matt dot farina at gmail dot com
Reported By: matt dot farina at gmail dot com
Status: Bogus
Bug Type: Filter related
PHP Version: 5.2.10
New Comment:
The documentation at
http://www.php.net/manual/en/filter.filters.validate.php
states that it
"Validates value as URL, optionally with required components." It does
not validate it to be a url. I setup a simple test and it validated
invalid urls.
I may not have reported it properly through your process and it may not
be the best solution but this is a bug. Either a documentation bug or a
functionality bug. This is not proper validation!
Previous Comments:
------------------------------------------------------------------------
[2009-08-09 12:56:51] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
.
------------------------------------------------------------------------
[2009-08-08 14:32:15] matt dot farina at gmail dot com
Description:
------------
FILTER_VALIDATE_URL doesn't actually validate a url. It passes the url
through parse_url (which according to the documentation is not meant to
validate a url). When tested against a test set this can be seen.
Instead of this method PHP should use a regex or some other method to
actually validate it. See
http://api.drupal.org/api/function/valid_url/6
for an example that is to RFC 3986.
I would hope for PHP 6 we can have it look for a valid IRL (with
international characters) as well.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49197&edit=1