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
 [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: Thu Dec 02 07:03:34 2021 UTC