#2393 [Opn->Bgs]: Can't use parse_url for url validation
| From: | hholzgra@php.net | Date: | Tue, 01 Oct 2002 19:54:46 +0000 |
| Subject: | #2393 [Opn->Bgs]: Can't use parse_url for url validation | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-21099@lists.php.net to get a copy of this message | ||
ID: 2393
Updated by: hholzgra@php.net
Reported By: bram@guts.nl
-Status: Open
+Status: Bogus
Bug Type: Feature/Change Request
Operating System: Linux
PHP Version: 3.0.12
New Comment:
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
as stated in the manual: parse_url() will try to parse even incomplete
urls. it is meant for input parsing, not for validation
Previous Comments:
------------------------------------------------------------------------
[2001-07-22 17:06:39] andy@php.net
reclassified
------------------------------------------------------------------------
[1999-09-27 19:06:38] bram@guts.nl
I use parse_url() to validate url's.
But that does not work in my opinion very wel..
<?
$url=parse_url("http://this is no host");
print $url["host"];
?>
print's out :
this is no host
That's not a valid host.
It should be cool if parse_url did some regexp to check.
Bram
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=2393&edit=1