織夢(mèng)DedeCms中出現(xiàn)Safe Alert: Request Error step 1/2 的解決方法

字號(hào):


    織夢(mèng)DedeCMS出現(xiàn)Safe Alert: Request Error step 1 ! 或Safe Alert: Request Error step 2!的解決方法
    這是由于新版中使用了SQL語句防注入功能引了的安全警告,在自定義模模型中使用了下面名稱
    union|sleep|benchmark|load_file|outfile之一
    都會(huì)引發(fā)這個(gè)警告,此外采集的內(nèi)容,如果有 ‘union 這類語法也會(huì)出現(xiàn)在這個(gè)警告,
    目前沒有100%完美的解決方法又能增強(qiáng)安全,又能防止注入
    可修改dedecms的db基類把安全檢查關(guān)掉
    打開include下的dedesql.class.php找到構(gòu)造函數(shù)
    代碼如下:
    function __construct($pconnect=false,$nconnect=true)
    {
    $this->isClose = false;
    $this->safeCheck = true;
    if($nconnect)
    {
    $this->Init($pconnect);
    }
    }
    把$this->safeCheck = true;改為$this->safeCheck = false;
    但是對(duì)于大多數(shù)網(wǎng)站,如果能正常運(yùn)行,建議不要修改
    此文件導(dǎo)致的錯(cuò)誤會(huì)在 data 中生成一個(gè) md5_safe.txt 建立提供這文件的網(wǎng)址給我們作參考,以便及時(shí)修正。