PHP 4.0 Bug #5359: post'ed form veriables get unwanted backslashes
| From: | terry at terrym dot com | Date: | Tue, 04 Jul 2000 14:03:13 +0000 |
| Subject: | PHP 4.0 Bug #5359: post'ed form veriables get unwanted backslashes | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-23318@lists.php.net to get a copy of this message | ||
From: terry@terrym.com
Operating system: Red Hat 6.2 Linux
PHP version: 4.0.0
PHP Bug Type: Scripting Engine problem
Bug description: post'ed form veriables get unwanted backslashes
Hello
Upon upgrading from PHP3 to PHP4, an app that had been working fine broke due to the addition of
backslashes where there should not have been any.
Thought this would be good to add to the incompatibilities page at:
http://www.php.net/version4/incompatibilities.php
Here is an example script that can be run under PHP3 and PHP4 with
different results:
------------------------
<html>
<body>
<?
if($CONTENT_LENGTH)
{
echo "var1=$var1<p>\nvar2=$var2<p>\n";
}
else
{
?>
<form method=post action= <? echo $PHP_SELF; ?>>
<input type=hidden name=var1 value="This='is it'">
<input type=hidden name=var2 value="This \(was\)">
<input type=submit>
</form>
<?
}
?>
</body>
</html>
------------------------
This produced the following results:
Under PHP3:
var1=This='is it'
var2=This \(was\)
Under PHP4
var1=This=\'is it\'
var2=This \\(was\\)
Note the extra unwanted back slashes, is this a bug? or a new feature?
(The above script and results were cut and pasted to avoid misstakes.)
Thank you for your attention to this matter
Terry