Bug #10918 Updated: $HTTP_POST_VARS incorrectly initialized.
| From: | bruce at causal dot com | Date: | Mon, 24 Sep 2001 07:49:27 +0000 |
| Subject: | Bug #10918 Updated: $HTTP_POST_VARS incorrectly initialized. | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-66449@lists.php.net to get a copy of this message | ||
ID: 10918
User updated by: bruce@causal.com
Reported By: bruce@causal.com
Old Status: Closed
Status: Open
Bug Type: Variables related
Operating System: Linux 2.4.3
PHP Version: 4.0.5
New Comment:
It appears this problem as I described earlier does exists in PHP 4.0.6.
Previous Comments:
------------------------------------------------------------------------
[2001-06-12 17:19:56] sniper@php.net
No feedback, considered fixed.
------------------------------------------------------------------------
[2001-05-23 02:14:51] sniper@php.net
I'm unable to reproduce this with PHP 4.0.6RC1.
Please try it: http://www.php.net/~andi/php-4.0.6RC1.tar.gz
And also, replace your php.ini with the php.ini-dist that
comes with the package. Then change the appropriate directives.
--Jani
------------------------------------------------------------------------
[2001-05-17 00:39:47] bruce@causal.com
Array variables acquired via the POST method do not appear in the $HTTP_POST_VARS array unless
magic_quotes_gpc is DISABLED.
For example, if one uses a checkbox array named thus:
<input type="checkbox" name="fred[]" value="1">
<input type="checkbox" name="fred[]" value="2">
<input type="checkbox" name="fred[]" value="3">
an array variable called $fred will appear in the global namespace (assuming register_globals is
ON). The same array variable should also appear as $HTTP_POST_VARS["fred"] (assuming
track_vars is ON).
The BUG results in $HTTP_POST_VARS["fred'] appearing, but not as an array variable. That
is, is_array($HTTP_POST_VARS["fred"]) returns FALSE. Further, the value of
$HTTP_POST_VARS["fred"] is the string literal "Array" which curiously is the
same string returned when an array variable is accessed in a scalar context.
If magic_quotes_qpc is DISABLED, this problem vanishes and the value of
$HTTP_POST_VARS["fred"] is the anticipated array of values of selected checkboxes.
It looks to me like PHP4 is storing the result of a scalar access to the array variable $fred in
$HTTP_POST_VARS["fred"] when magic_quotes_gpc is enabled. I think this qualifies as a bug.
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=10918&edit=1