PHP :: Bug #71646 :: parse_url fails to parse relative url with port-like string in url
php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71646 parse_url fails to parse relative url with port-like string in url
Submitted: 2016-02-22 18:28 UTC Modified: 2016-02-23 14:55 UTC
Votes:7
Avg. Score:4.3 ± 0.7
Reproduced:7 of 7 (100.0%)
Same Version:1 (14.3%)
Same OS:4 (57.1%)
From: jona at mode dot com Assigned:
Status: Open Package: URL related
PHP Version: 5.6.18 OS: linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2016-02-22 18:28 UTC] jona at mode dot com
Description:
------------
When a relative URL without a scheme and port, but with a port-like string (e.g. /example.com/foo:1234) is passed to parse_url(), it fails to parse the URL (returning false).

Test script:
---------------
var_dump(parse_url("/foo/bar:1"));

Expected result:
----------------
array(1) {
  ["path"]=>
  string(10) "/foo/bar:1"
}

Actual result:
--------------
false

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-02-23 12:04 UTC] cmb@php.net
This appears to be a duplicate of bug #70942.
 [2016-02-23 14:55 UTC] jona at mode dot com
This bug is for a relative URL. Bug 70942 is a schema-less absolute URL.
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Sun Aug 19 00:01:26 2018 UTC