For Programmers: Free Programming Magazines  


Home > Archive > PHP Documentation > February 2007 > #40675 [Opn]: Documentation for FILTER_VALIDATE_URL appears out of date









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author #40675 [Opn]: Documentation for FILTER_VALIDATE_URL appears out of date
walter dot tom+php at gmail dot com

2007-02-28, 10:00 pm

ID: 40675
User updated by: walter dot tom+php at gmail dot com
Reported By: walter dot tom+php at gmail dot com
Status: Open
Bug Type: Documentation problem
-PHP Version: Irrelevant
+PHP Version: 5.2.1
New Comment:

Oops, for some reason lost the version number when I first submitted.


Previous Comments:
------------------------------------------------------------------------

[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
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com