Bug #68917 [Ver->Csd]: parse_url fails on some partial urls
| From: | datibbaw@php.net | Date: | Fri, 06 Mar 2015 13:04:37 +0000 |
| Subject: | Bug #68917 [Ver->Csd]: parse_url fails on some partial urls | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-191214@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=68917&edit=1
ID: 68917
Updated by: datibbaw@php.net
Reported by: me at evertpot dot com
Summary: parse_url fails on some partial urls
-Status: Verified
+Status: Closed
Type: Bug
Package: *URL Functions
Operating System: any
PHP Version: 5.6.5
Assigned To: demon
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of datibbaw
Revision: http://git.php.net/?p=php-src.git;a=commit;h=d7fb52ea20aba5c9ef53dfa57af3b62717c9e9e5
Log: Fixed bug #68917 (parse_url fails on some partial urls)
Previous Comments:
------------------------------------------------------------------------
[2015-01-27 00:43:51] me at evertpot dot com
Yea, I think it can really use a deep look into RFC3986 and a fresh start :) It looks like it had a
number of edge-cases fixed in the past.
------------------------------------------------------------------------
[2015-01-27 00:16:58] requinix@php.net
http://3v4l.org/MpY8k
I can't quite wrap my head around what ext/standard/url.c's php_url_parse_ex is doing
without a debugger but it seems the combination of a colon + numbers and leading slash(es) confuses
the code.
It also seems like the same problem as in bug #66813 except this time the (unencoded) colon is in
the right location.
------------------------------------------------------------------------
[2015-01-26 22:16:52] me at evertpot dot com
Description:
------------
parse_url will fail for urls that don't have a scheme, but do have a port
Test script:
---------------
<?php
print_r(parse_url('//example.org:81/hi?a=b#c=d'));
print_r(parse_url('//example.org/hi?a=b#c=d'));
Expected result:
----------------
Array
(
[host] => example.org
[port] => 81
[path] => /hi
[query] => a=b
[fragment] => c=d
)
Array
(
[host] => example.org
[path] => /hi
[query] => a=b
[fragment] => c=d
)
Actual result:
--------------
Array
(
[host] => example.org
[path] => /hi
[query] => a=b
[fragment] => c=d
)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=68917&edit=1