#33904 [Opn->Bgs]: PHP adds magic quotes to posted arrays when it shouldn't
| From: | sniper@php.net | Date: | Thu, 28 Jul 2005 14:22:03 +0000 |
| Subject: | #33904 [Opn->Bgs]: PHP adds magic quotes to posted arrays when it shouldn't | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-82595@lists.php.net to get a copy of this message | ||
ID: 33904
Updated by: sniper@php.net
Reported By: php at kanariepiet dot com
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Linux 2.4.31 and Mac OS X 10.4.2
PHP Version: 5.0.4
New Comment:
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. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
Then you're not setting it correctly. Works fine for me.
(check that the right php.ini file is loaded)
Previous Comments:
------------------------------------------------------------------------
[2005-07-28 15:36:24] php at kanariepiet dot com
Description:
------------
With magic_quotes_gpc turned off, PHP shouldn't add quotes to
posted variables. This is true for normal variables like
<input type="text" name="test" value="foo'bar">.
However, when posting associative arrays like <input
type="text" name="test[foo'bar]" value="dummy"> PHP 5.0.4 adds
a quote before the '.
PHP 4.3.4 does not have this bug.
Reproduce code:
---------------
<?php print_r ($_POST); ?>
<form method="post">
<input type="text" name="foo'bar" value="dummy">
<input type="submit">
</form>
Expected result:
----------------
With magic_quotes_gpc turned off, it should say (and PHP 4.3.4
does):
Array
(
[foo'bar] => dummy
)
Actual result:
--------------
However, with PHP 5.0.4 it says:
Array
(
[foo\'bar] => dummy
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33904&edit=1