相关疑难解决方法(0)

magic_quotes_gpc()的解毒剂?

我已经看过几十个这样的PHP代码片段:

function DB_Quote($string)
{
    if (get_magic_quotes_gpc() == true)
    {
        $string = stripslashes($string);
    }

    return mysql_real_escape_string($string);
}
Run Code Online (Sandbox Code Playgroud)

如果我打电话DB_Quote("the (\\) character is cool");会怎么样?(谢谢jspcal!)

难道我们不应该只在剥离斜线get_magic_quotes_gpc() == true 价值源于$_GET,$_POST$_COOKIE超全局变量?

php stripslashes magic-quotes-gpc addslashes

1
推荐指数
2
解决办法
1497
查看次数

标签 统计

addslashes ×1

magic-quotes-gpc ×1

php ×1

stripslashes ×1