新版的织梦dedecms修改了 include 文件夹中的 common.func.php,增加了两个函数,而由于某些原因,例如:下载了某个以前的模板文件,如果此模板中提供了 common.func.php 文件,并且没有这两个函数的话,就会造成错误。
因为安装的模板会更新 common.func.php文件,导入缺号函数make_hash,所以出现这样的错误。
如果网站打开详细错误提示会显示 Fatal error: Call to undefined function make_hash() ,如果没开则一片空白,很恼火哦
解决的办法把一下内容追加到include文件夹下的common.func.php里即可
function make_hash()
{
$rand = dede_random_bytes(16);
$_SESSION['token'] = ($rand === FALSE)
? md5(uniqid(mt_rand(), TRUE))
: bin2hex($rand);
return $_SESSION['token']