|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-12-12 19:21 UTC] aharvey@php.net
-Summary: parse_url depends on scheme
+Summary: Support protocol-relative URLs in parse_url
-Type: Bug
+Type: Feature/Change Request
-Package: *General Issues
+Package: URL related
[2013-12-12 19:21 UTC] aharvey@php.net
[2015-01-26 22:14 UTC] me at evertpot dot com
[2015-01-27 00:20 UTC] requinix@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: requinix
[2015-01-27 00:20 UTC] requinix@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 21 05:00:01 2025 UTC |
Description: ------------ parse_url gets lost when providing an url with no scheme in front, this goes totally against the RFC which allows urls with no scheme Test script: --------------- php > echo var_dump(parse_url("//search.yahoo.com/search?p=car")); array(2) { ["path"]=> string(25) "//search.yahoo.com/search" ["query"]=> string(5) "p=car" } php > echo var_dump(parse_url("http://search.yahoo.com/search?p=car")); array(4) { ["scheme"]=> string(4) "http" ["host"]=> string(16) "search.yahoo.com" ["path"]=> string(7) "/search" ["query"]=> string(5) "p=car" } Expected result: ---------------- php > echo var_dump(parse_url("//search.yahoo.com/search?p=car")); array(2) { ["host"]=> string(16) "search.yahoo.com" ["path"]=> string(7) "/search" ["query"]=> string(5) "p=car" }