PHP 5.3 automatically escapes $_GET/$_POST from form strings?

后端 未结 4 1049
庸人自扰
庸人自扰 2020-12-06 19:43

My server admin recently upgraded to PHP 5.3 and I\'m getting a weird \"bug\" (or feature, as the PHP folks have it). I had mysql_real_escape_string around most

4条回答
  •  萌比男神i
    2020-12-06 20:00

    This is due to magic quotes, you should turn it off.

    And here is how you turn it off: http://www.php.net/manual/en/security.magicquotes.disabling.php

    You do it either via php.ini or by removing slashes from all variables in $_GET and $_POST, obviously the former is the recommended way to go.


    As Will Martin suggests you can also change it via a .htaccess like this:

    php_flag magic_quotes_gpc off
    

    More info here: http://php.net/manual/en/configuration.changes.php

提交回复
热议问题