织梦DedeCms出现Safe Alert: Request Error step 1/2 ! 解决方法

2017-04-13 21:01:37 dedecms

织梦

DedeCms出现Safe Alert: Request Error step 1 ! 或Safe Alert: Request Error step 2!的解决办法

这是由于新版中使用了SQL语句防注入功能引了的安全警告,在自定义模模型中使用了下面名称 union|sleep|benchmark|load_file|outfile之一

都会引发这个警告,此外采集的内容,如果有 'union 这类语法也会出现在这个警告,

目前没有100%完美的解决办法又能增强安全,又能防止注入 可修改DedeCMS的db基类把安全检查关掉

打开include下的dedesql.class.php找到构造函数

function __construct($pconnect=false,$nconnect=true) { $this->isClose = false; $this->safeCheck = true; if($nconnect) { $this->Init($pconnect); } }

把$this->safeCheck = true;改为$this->safeCheck = false;

但是对于大多数网站,如果能正常运行,建议不要修改 此文件导致的错误会在 data 中生成一个 md5_safe.txt 建立提供这文件的网址给我们作参考,以便及时修正。