|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2015-12-28 19:31 UTC] zelnaga at gmail dot com
Description:
------------
If you urlencode a character in a URL than the parsed version of that URL ought to contain that character urldecoded in the output.
Test script:
---------------
<?php
$a = parse_url('https://www.google.com/se%61rch?q=test');
print_r($a);
Expected result:
----------------
Array
(
[scheme] => https
[host] => www.google.com
[path] => /search
[query] => q=test
)
Actual result:
--------------
Array
(
[scheme] => https
[host] => www.google.com
[path] => /se%61rch
[query] => q=test
)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 07:00:01 2025 UTC |
I don't think it should be decoded at that level here. Think of requests like the following: var_dump(parse_url("/?foo=ab%26bar%3Dfoo")); var_dump(parse_url(urldecode("/?foo=ab%26bar%3Dfoo"))); var_dump(parse_url("/foo%2Fab/bar")); var_dump(parse_url(urldecode("/foo%2Fab/bar"))); I guess the last one is negligible, but I could well see the first example ...