php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5359 post'ed form veriables get unwanted backslashes
Submitted: 2000-07-04 16:03 UTC Modified: 2000-07-04 16:07 UTC
From: terry at terrym dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0.0 OS: Red Hat 6.2 Linux
Private report: No CVE-ID: None
 [2000-07-04 16:03 UTC] terry at terrym dot com
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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-04 16:07 UTC] stas at cvs dot php dot net
turn off magic_quotes_gpc parameter in php.ini
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Oct 10 17:00:01 2026 UTC