gpt4 book ai didi

php - 什么是 PHP 中的魔术引号运行时?

转载 作者:可可西里 更新时间:2023-10-31 22:49:46 25 4
gpt4 key购买 nike

我完全知道 PHP 中魔术引号的异常,它是多么邪恶,我像害虫一样避免它们,但什么是 magic_quotes_runtime?来自 php.ini:

Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.

这是我应该检查是否打开并关闭的东西:

set_magic_quotes_runtime(false);

它是否经常默认开启?我知道它在 5.3.0 中已被弃用并在 6.0.0 中被删除,但由于我的脚本支持 5.1.0+,我想知道如何在“旧版”PHP 中处理此问题(如果相关)。

编辑:为了清楚起见,我想退出('Turn OFF Magic Quotes');当魔术引号打开时。我不依赖他们!

最佳答案

If magic_quotes_runtime is enabled, most functions that return data from any sort of external source including databases and text files will have quotes escaped with a backslash. If magic_quotes_sybase is also on, a single-quote is escaped with a single-quote instead of a backslash.

http://www.php.net/manual/en/info.configuration.php#ini.magic-quotes-runtime

关于php - 什么是 PHP 中的魔术引号运行时?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2118505/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com