|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74780 parse_url() borken when query string contains colon
Submitted: 2017-06-19 12:13 UTC Modified: 2017-06-20 18:08 UTC
Avg. Score:4.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: Assigned: jhdxr (profile)
Status: Closed Package: URL related
PHP Version: 7.2.0alpha1 OS:
Private report: No CVE-ID: None
 [2017-06-19 12:13 UTC]
When query string contains : (colon) parse_url() fails parses relative URIs improperly (like it happened before 5.4.7).

For 5.6 or older: If query string contains e.g. `a=1:337` then `port` will be `337`, when it's e.g. `a=b:c` then the port is correct.

Test script:


Expected result:
array(3) {
  string(7) ""
  string(33) "/manual/en/function.parse-url.php"
  string(7) "v=1:337"

Actual result:
array(2) {
  string(42) "//"
  string(7) "v=1:337"


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-06-20 18:08 UTC]
-Summary: parse_url() borks when query string contains colon +Summary: parse_url() borken when query string contains colon -Status: Open +Status: Assigned -Package: *General Issues +Package: URL related -Assigned To: +Assigned To: jhdxr
 [2017-06-22 10:53 UTC]
Automatic comment on behalf of jhdxr
Log: fix bug #74780 parse_url() borken when query string contains colon
 [2017-06-22 10:53 UTC]
-Status: Assigned +Status: Closed
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC