|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-07-28 15:36 UTC] 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 ) PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 02:00:01 2025 UTC |
php5-200507281430 gives the same results as php-5.0.4: <?php print_r ($_POST); ?> <form method="post"> <input type="text" name="foo'bar" value="bar'foo"> </form> returns Array ( [foo\'bar] => bar'foo )