#40675 [Opn->Asn]: Documentation for FILTER_VALIDATE_URL appears out of date
| From: | philip@php.net | Date: | Thu, 01 Mar 2007 16:51:15 +0000 |
| Subject: | #40675 [Opn->Asn]: Documentation for FILTER_VALIDATE_URL appears out of date | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969375696@lists.php.net to get a copy of this message | ||
ID: 40675
Updated by: philip@php.net
Reported By: walter dot tom+php at gmail dot com
-Status: Open
+Status: Assigned
Bug Type: Documentation problem
PHP Version: 5.2.1
-Assigned To:
+Assigned To: pajoye
New Comment:
You bring up some good points. After briefly speaking with Pierre the
following came to light:
* The default behavior of FILTER_VALIDATE_URL was changed at some
point
* FILTER_FLAG_SCHEME_OPTIONAL should exist instead
* Likely the same to create FILTER_FLAG_HOST_OPTIONAL, he'll look
* So, at first glance, those two _REQUIRED constants have no meaning
today
As requested, this bug is being assigned to Pierre and he'll work on it
this weekend. Thank you for the nice bug report :)
Previous Comments:
------------------------------------------------------------------------
[2007-03-01 03:09:03] walter dot tom+php at gmail dot com
Oops, for some reason lost the version number when I first submitted.
------------------------------------------------------------------------
[2007-03-01 03:07:10] walter dot tom+php at gmail dot com
Description:
------------
The current documentation for FILTER_VALIDATE_URL
(http://www.php.net/filter) mentions flags for
FILTER_FLAG_HOST_REQUIRED and FILTER_FLAG_SCHEME_REQUIRED, which
suggest that an input that doesn't include a host or scheme such as a
relative URL SHOULD validate as long as it doesn't include those flags.
However they do not.
Reproduce code:
---------------
$var = filter_var('/mypath.html', FILTER_VALIDATE_URL);
$var = filter_var('google.com', FILTER_VALIDATE_URL);
Expected result:
----------------
Both return false, however given the current documentation, one would
expect them to return true.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40675&edit=1