#23454 [Com]: Combining GET and POST array values with register_globals=on and track_vars=on
| From: | michael dot mauch at gmx dot de | Date: | Fri, 02 May 2003 23:30:14 +0000 |
| Subject: | #23454 [Com]: Combining GET and POST array values with register_globals=on and track_vars=on | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-38973@lists.php.net to get a copy of this message | ||
ID: 23454
Comment by: michael dot mauch at gmx dot de
Reported By: oregon at pobox dot com
Status: Open
Bug Type: Arrays related
Operating System: ANY
PHP Version: 4.3.1
New Comment:
It's not only with about register_globals=on, the GET data are also
missing from $_REQUEST if register_globals=off.
Previous Comments:
------------------------------------------------------------------------
[2003-05-02 18:03:06] stone@php.net
AFAIK register_globals is still supported in 4.3. versions.
------------------------------------------------------------------------
[2003-05-02 17:52:16] helly@php.net
We do no longer support register_globals=on since it causes to much
trouble in the code base.
------------------------------------------------------------------------
[2003-05-02 17:45:49] michael dot mauch at gmx dot de
Complete script:
<form action="bug23454.php?person[age]=27" method=post>
<input type=text size=32 name="person[sname]">
<input type=submit>
</form>
<pre>
<?php
print "_REQUEST: "; print_r($_REQUEST);
print "_GET: "; print_r($_GET);
print "_POST: "; print_r($_POST);
print "person: "; print_r($person);
?>
</pre>
In 4.2.3 with register_globals on, I get both the POST and GET data
in $_REQUEST, $person, $_GET (wrong), $_POST (wrong).
In 4.2.3 with register_globals off, I get the POST data
in $_REQUEST and $_POST, the GET data only in $_GET (not in
$_REQUEST).
In php4-STABLE-200305011130 with register_globals on, I see the POST
data in $_REQUEST, $_POST and $person, but the GET data is only in
$_GET (not in $_REQUEST and not in $person).
In php4-STABLE-200305011130 with register_globals off, it's the same as
with 4.2.3 - i.e. the GET data is missing from $_REQUEST.
To me, this does indeed look like a bug.
I also checked with non-array variables: fortunately they do work
like advertized.
------------------------------------------------------------------------
[2003-05-02 14:35:39] oregon at pobox dot com
When both GET and POST variables are sent at the same time to the same
array, the GET variables are not getting set correctly (with
register_globals=on and track_vars=on).
Example:
<form action="bug?person[age]=12" method=post>
<input type=text size=32 name=person[sname]
</form>
With register_globals=on and track_vars=on, the script should get both
$person['age'] and $person['sname'], and this worked properly in
earlier versions of PHP (at least up to 4.2.3). But as of 4.3.1, the
POST variable is getting set but the GET variable is lost. This is
causing properly written scripts to break under new versions of PHP.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23454&edit=1