|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80114 parse_url does not accept URLs with port 0
Submitted: 2020-09-17 01:52 UTC Modified: 2020-09-17 13:06 UTC
From: gtisza at gmail dot com Assigned: cmb (profile)
Status: Closed Package: *URL Functions
PHP Version: 7.3 OS: *
Private report: No CVE-ID: None
 [2020-09-17 01:52 UTC] gtisza at gmail dot com
parse_url fails to parse URLs with port 0 (like 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 ). At a minimum, if this is an intentional constraint, it should be documented.

Test case:
Affects all PHP versions starting with 5.3.6 (before it was parsed as expected).

See also #62159.

Test script:
var_dump( parse_url('') );

var_dump( parse_url('') );


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-09-17 12:58 UTC]
-Status: Open +Status: Verified -Assigned To: +Assigned To: cmb
 [2020-09-17 13:05 UTC]
The following pull request has been associated:

Patch Name: Fix #80114: parse_url does not accept URLs with port 0
On GitHub:
 [2020-09-17 13:05 UTC]
-PHP Version: 8.0.0beta3 +PHP Version: 7.3
 [2020-09-17 13:06 UTC]
-Operating System: Linux +Operating System: *
 [2020-09-20 13:39 UTC]
Automatic comment on behalf of
Log: Fix #80114: parse_url does not accept URLs with port 0
 [2020-09-20 13:39 UTC]
-Status: Verified +Status: Closed
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Apr 20 04:01:23 2021 UTC