织梦DedeCms中出现Safe Alert: Request Error step 1/2 的解决方法
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>织梦DedeCMS出现Safe Alert: Request Error step 1 ! 或Safe Alert: Request Error step 2!的解决方法<br>
这是由于新版中使用了SQL语句防注入功能引了的安全警告,在自定义模模型中使用了下面名称<br>
union|sleep|benchmark|load_file|outfile之一<br>
都会引发这个警告,此外采集的内容,如果有 ‘union 这类语法也会出现在这个警告,<br>
目前没有100%完美的解决方法又能增强安全,又能防止注入<br>
可修改dedecms的db基类把安全检查关掉<br>
打开include下的dedesql.class.php找到构造函数<br>
</p>
<div class="msgheader" style='margin: 3px auto 0px; padding: 0px 3px; outline: none; line-height: 21.6px; clear: both; border-width: 1px; border-style: solid; border-color: rgb(0, 153, 204); background: rgb(246, 251, 255); overflow: hidden; font-family: tahoma, arial, "Microsoft YaHei";'>
<div class="right">
<span><u>复制代码</u></span>
</div>
<p>
代码如下:</p>
</div>
<div class="msgborder" id="phpcode1" style='margin: 0px auto 3px; padding: 0px 3px; outline: none; line-height: 25.2px; font-size: 14px; clear: both; border-right: 1px solid rgb(0, 153, 204); background: rgb(221, 237, 251); overflow: hidden; border-left: 1px solid rgb(0, 153, 204); word-break: break-all; border-bottom: 1px solid rgb(0, 153, 204); word-wrap: break-word; font-family: tahoma, arial, "Microsoft YaHei";'>
<br>
function __construct($pconnect=false,$nconnect=true)<br>
{<br>
$this->isClose = false;<br>
$this->safeCheck = true;<br>
if($nconnect)<br>
{<br>
$this->Init($pconnect);<br>
}<br>
}</div>
<p>
<br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>把$this->safeCheck = true;改为$this->safeCheck = false;</span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>但是对于大多数网站,如果能正常运行,建议不要修改</span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>此文件导致的错误会在 data 中生成一个 md5_safe.txt 建立提供这文件的网址给我们作参考,以便及时修正。</span></p>
頁:
[1]