织梦cms报错“CSRF token Check Failed”,以下是解决办法:
1、打开dede/config.php,找到第63行:
function csrf_check() { global $token; if(!isset($token) || strcasecmp($token, $_SESSION['token']) != 0){ echo '<a href="http://bbs.dedecms.com/907721.html">DedeCMS:CSRF Token Check Failed!</a>'; exit; } }
修改为:
function csrf_check() { return; global $token; if(!isset($token) || strcasecmp($token, $_SESSION['token']) != 0){ echo '<a href="http://bbs.dedecms.com/907721.html">DedeCMS:CSRF Token Check Failed!</a>'; exit; } }
2、打开dede/tpl.php,将第93行代码注释掉即可
if ( empty(${$_csrf['name']}) OR $_csrf['hash'] !== ${$_csrf['name']}) { //exit('Error:no csrf hash code!'); }