php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23744 $_REQUEST no more includes $_GET variables?
Submitted: 2003-05-21 16:20 UTC Modified: 2003-05-21 17:57 UTC
From: i dot thierack at iwt-promotion dot net Assigned: iliaa (profile)
Status: Closed Package: URL related
PHP Version: 4.3.2RC3 OS: Debian 3.0
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: i dot thierack at iwt-promotion dot net
New email:
PHP Version: OS:

 

 [2003-05-21 16:20 UTC] i dot thierack at iwt-promotion dot net
Hello,

following problem with 4.3.2RC3 (it works with 4.3.1)

Browser URL :
http://intraddms/fiatbearb/adr_index.php?1234567890

var_dump from $_REQUEST

array(2) { [0]=>  string(1) "0" ["PHPSESSID"]=>  string(32)
"3f8ee06297a919da9d84cd713473fe5d" }

if have a query like

if(!isset($_REQUEST["1234567890"]){ << BUG? it's alway true
 initialize some variables
}

if i replace it with $_GET it works. Switch back to 4.3.1 it works also with $_REQUEST

regards
Ingo Thierack

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-21 16:59 UTC] sniper@php.net
This was broken by another fix related to $_REQUEST.
Assigned to Ilia who broke it. :)

 [2003-05-21 17:38 UTC] michael dot mauch at gmx dot de
The problem appears only with numeric argument names:

test.php?123=45   =>

_REQUEST: Array
(
    [0] => 45
)
_GET: Array
(
    [123] => 45
)

test.php?a123=45   =>

_REQUEST: Array
(
    [a123] => 45
)
_GET: Array
(
    [a123] => 45
)
 [2003-05-21 17:49 UTC] rasmus@php.net
This may very well be a "Won't Fix" but we will see what Ilia thinks.

This has traditionally not worked very reliably.  PHP has always expected to see valid variable names in the get and post key/value pairs.  For example, try putting a . (dot) in a variable name.  You will see it gets converted to an underscore.  The idea here is that anything in $_GET/$_POST/$_COOKIE can be extract()'ed directly into the symbol table and you can't have variables called $123 and $.abc so these variable names are technically not supported in our GPC arrays.  That doesn't mean you can't use them, you will just have to do a bit of work yourself.  In your case you would need to look at $QUERY_STRING and parse that.
 [2003-05-21 17:57 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Oct 07 14:01:27 2024 UTC