織夢(mèng)DedeCms中出現(xiàn)Safe Alert: Request Error step 1/2 的解決方法
2016-09-06 17:36:54
18334
織夢(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)安全,又能防止注入的方法??尚薷膁edecms的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文件。 這文件會(huì)提供的相關(guān)錯(cuò)誤給我們作為參考,以便及時(shí)修正。