php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30460 vars from querystring are bad/wrong urldecoded
Submitted: 2004-10-16 21:06 UTC Modified: 2004-10-17 02:32 UTC
From: smsc at gmx dot de Assigned:
Status: Not a bug Package: Variables related
PHP Version: 4.3.8 OS: Any
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: smsc at gmx dot de
New email:
PHP Version: OS:

 

 [2004-10-16 21:06 UTC] smsc at gmx dot de
Description:
------------
Passing variables like e.g. urls which contain a + char in filenames or simple math questions like 1+1 is not possible because vars are urldecoded before they are passed on within php. A "+" in the variable is always "decoded" to space, which makes it impossible to take user input like not encoded urls or math questions directly but requires parsing by hand from querystring.

Reproduce code:
---------------
print $_SERVER['QUERY_STRING']."<BR>";
print $_GET['var']."<BR>";
print $var;

called with ..script.php?var=1+1 (register_globals on)


Expected result:
----------------
var=1+1
1+1
1+1

Actual result:
--------------
var=1+1
1 1
1 1

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-10-17 02:32 UTC] derick@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

This is a feature, not a bug.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 00:01:30 2024 UTC