Bug #80114 [Ver->Csd]: parse_url does not accept URLs with port 0
| From: | cmb@php.net | Date: | Sun, 20 Sep 2020 13:39:06 +0000 |
| Subject: | Bug #80114 [Ver->Csd]: parse_url does not accept URLs with port 0 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-229099@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=80114&edit=1
ID: 80114
Updated by: cmb@php.net
Reported by: gtisza at gmail dot com
Summary: parse_url does not accept URLs with port 0
-Status: Verified
+Status: Closed
Type: Bug
Package: *URL Functions
Operating System: *
PHP Version: 7.3
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=81b2f3e5d9fcdffd87a4fcd12bd8c708a97091e1
Log: Fix #80114: parse_url does not accept URLs with port 0
Previous Comments:
------------------------------------------------------------------------
[2020-09-17 13:05:41] cmb@php.net
The following pull request has been associated:
Patch Name: Fix #80114: parse_url does not accept URLs with port 0
On GitHub: https://github.com/php/php-src/pull/6152
Patch: https://github.com/php/php-src/pull/6152.patch
------------------------------------------------------------------------
[2020-09-17 01:52:28] gtisza at gmail dot com
Description:
------------
parse_url fails to parse URLs with port 0 (like https://example.com:0/). While 0 is not a valid port, it is
possible to send requests to it, and URLs with a zero port can be used for all kinds of purposes (
the URI itself is valid per https://tools.ietf.org/html/rfc3986#section-3.2.3
). At a minimum, if this is an intentional constraint, it should be documented.
Test case: https://3v4l.org/36TqT
Affects all PHP versions starting with 5.3.6 (before it was parsed as expected).
See also #62159.
Test script:
---------------
var_dump( parse_url('https://example.com:1/')
);
var_dump( parse_url('https://example.com:0/')
);
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80114&edit=1