php - 使用magic_quotes()会影响mysql_real_escape_string()的使用吗

标签 php mysql mysql-real-escape-string magic-quotes

如果我打开了 magic_quotes 并使用 mysql_real_escape_string,字符串会被双重转义吗?会不会出问题?

我基于 get_magic_quotes() 函数假设是这样,但只是寻求确认。

(附:问这个问题比在我的办公室用我们所有的安全措施测试它更容易 - 我需要 10-15 来配置一切以获得可用的环境)

最佳答案

阅读documentation of mysql_real_escape_string (我希望这也不难):

Note: If magic_quotes_gpc is enabled, first apply stripslashes() to the data. Using this function on data which has already been escaped will escape the data twice.

关于php - 使用magic_quotes()会影响mysql_real_escape_string()的使用吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2688526/

相关文章:

php - 在库文件codeigniter中加载不同的数据库

mysql - 如何选择列及其最大值

php - 为什么 PDO 比 mysql_real_escape_string 更适合转义 MySQL 查询/查询字符串?

php - JQuery - 将 HTML 加载到文本区域

php - 根据容器宽度截断 PHP 字符串

php - 使用 php nusoap 下载 mysql 表

mysql - 如何对中间有空值的两个数据进行升序

javascript - 将 HTML 报告转换为 PDF

php - 如何从不同文件和数组变量中的 mysql_fetch_assoc() 访问连续行?

php - mysql_real_escape_string 和撇号问题