php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30882 urldecoding (%26) before argument splitting in GET requests
Submitted: 2004-11-24 15:00 UTC Modified: 2004-11-24 23:27 UTC
From: bzeeb+php at zabbadoz dot net Assigned:
Status: Closed Package: URL related
PHP Version: 5.0.2 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: bzeeb+php at zabbadoz dot net
New email:
PHP Version: OS:

 

 [2004-11-24 15:00 UTC] bzeeb+php at zabbadoz dot net
Description:
------------
urldecoding seems to be done before arguemtns get split
for $_REQUEST etc.

Thus foo=test%026test becomes:
  foo=test
  test=
instead of
  foo=test&test

worked correctly in php 4.3.3.


Reproduce code:
---------------
<?
if (isset($_REQUEST['foo'])) {
  echo "<tt>'" . $_REQUEST['foo'] . "'</tt> -- ";
  print_r($_REQUEST);
}
?>

Expected result:
----------------
GET test.php?foo=test+test
Expected: 'test test' -- Array ( [foo] => test test )
-> As expected

GET test.php?foo=test+test%26test
Expected: 'test test&test' -- Array ( [foo] => test test&test )

Actual result:
--------------
GET test.php?foo=test+test
Result: 'test test' -- Array ( [foo] => test test )
-> As expected

GET test.php?foo=test+test%26test
Result: 'test test' -- Array ( [foo] => test test [test] => ) 
-> BUG.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-11-24 23:27 UTC] iliaa@php.net
Works fine in latest CVS.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Dec 04 14:03:34 2021 UTC