Edit report at https://bugs.php.net/bug.php?id=70942&edit=1
ID: 70942
Updated by: cmb@php.net
Reported by: taco at procurios dot nl
Summary: parse_url for url without port and scheme, but with
port-like string in url
-Status: Open
+Status: Not a bug
Type: Bug
Package: URL related
Operating System: linux
PHP Version: 5.6.15
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
The problem is that parse_url() is so broken for partial URLs,
that whenever you fix something related to this, you likely
introduce a regression. Thus, it's likely best to introduce a new
function with sane parsing conforming to RFC 3986. This would
require the RFC process[1], though.
Anyhow, it is already documented[2] that
| Partial URLs are also accepted, parse_url() tries its best to
| parse them correctly.
So this is not a bug.
[1] <https://wiki.php.net/rfc/howto>
[2] <https://www.php.net/parse_url>
Previous Comments:
------------------------------------------------------------------------
[2021-04-21 12:21:30] cmb@php.net
Related To: Bug #71646
------------------------------------------------------------------------
[2016-08-17 09:50:24] driezasson at icloud dot com
Even a URL with a port, but without a scheme doesnât get parsed. E.g.:
'//example.com:80/'.
Expected result:
['host' => 'example.com', 'port' => 80]
Actual result:
false
------------------------------------------------------------------------
[2016-02-23 14:55:34] jona at mode dot com
Related To: Bug #71646
------------------------------------------------------------------------
[2016-02-23 12:04:47] cmb@php.net
Related To: Bug #71646
------------------------------------------------------------------------
[2015-11-20 14:46:26] laruence@php.net
@datibbaw, could you have a look into this one? thanks
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=70942
--
Edit this bug report at https://bugs.php.net/bug.php?id=70942&edit=1