如果我打开了 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 applystripslashes()
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/