#49832 [Opn->Bgs]: parse_url won't parse properly a.com:::
| From: | Sjoerd@php.net | Date: | Sun, 11 Oct 2009 09:08:38 +0000 |
| Subject: | #49832 [Opn->Bgs]: parse_url won't parse properly a.com::: | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-143458@lists.php.net to get a copy of this message | ||
ID: 49832
Updated by: Sjoerd@php.net
Reported By: marius dot andreiana at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: URL related
Operating System: Linux
PHP Version: 5.2.11
New Comment:
I don't think this is a bug.
From the documentation of parse_url:
This function is not meant to validate the given URL, it only breaks it
up into the above listed parts. Partial URLs are also accepted,
parse_url() tries its best to parse them correctly. [...] On seriously
malformed URLs, parse_url() may return FALSE and emit a E_WARNING.
Previous Comments:
------------------------------------------------------------------------
[2009-10-10 18:44:42] marius dot andreiana at gmail dot com
Indeed it's not valid.
Therefore parse_url should return false, this is the bug.
Now returns: Array ( [scheme] => http [host] => a.com:: )
Expected: return false
------------------------------------------------------------------------
[2009-10-10 18:06:50] Sjoerd@php.net
Thank you for your bug report.
Your example URL, "http://a.com:::", does not seem
valid to me. Why do
you think this URL is valid?
------------------------------------------------------------------------
[2009-10-10 15:48:29] marius dot andreiana at gmail dot com
Description:
------------
http://a.com:::
Array ( [scheme] => http [host] => a.com:: )
expected: return false
Reproduce code:
---------------
$url_parts = parse_url("http://a.com:::");
print_r($url_parts);
Expected result:
----------------
See Description
Actual result:
--------------
See Description
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49832&edit=1