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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-11-24 23:27 UTC] iliaa@php.net
Works fine in latest CVS.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 07:01:33 2025 UTC