#33904 [NEW]: PHP adds magic quotes to posted arrays when it shouldn't
| From: | php at kanariepiet dot com | Date: | Thu, 28 Jul 2005 13:36:25 +0000 |
| Subject: | #33904 [NEW]: PHP adds magic quotes to posted arrays when it shouldn't | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-82592@lists.php.net to get a copy of this message | ||
From: php at kanariepiet dot com
Operating system: Linux 2.4.31 and Mac OS X 10.4.2
PHP version: 5.0.4
PHP Bug Type: Scripting Engine problem
Bug description: PHP adds magic quotes to posted arrays when it shouldn't
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 bug report at http://bugs.php.net/?id=33904&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33904&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=33904&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=33904&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=33904&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=33904&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=33904&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=33904&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=33904&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=33904&r=support
Expected behavior: http://bugs.php.net/fix.php?id=33904&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=33904&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=33904&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=33904&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33904&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=33904&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=33904&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=33904&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=33904&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=33904&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=33904&r=mysqlcfg