织梦dedecms出现系统基本参数空白或显示Call to undefined function make_hash()
最新的织梦版本(2018-01-09)修改了include文件夹中的common.func.php, 增加了两个函数。
下载的模板文件夹中如果提供了common.func.php文件,很有可能没有这两个函数,于是会造成错误。
需要将这两个函数的代码粘贴到/include/common.func.php文件中,代码如下:
05
$rand = dede_random_bytes(16);
07
$_SESSION[
'token'
] = ($rand === FALSE)
09
? md5(uniqid(mt_rand(), TRUE))
13
return
$_SESSION[
'token'
];
17
function
dede_random_bytes($length)
21
if
(empty($length) OR ! ctype_digit((string) $length))
29
if
(function_exists(
'random_bytes'
))
37
return
random_bytes((int) $length);
51
if
(defined(
'MCRYPT_DEV_URANDOM'
) && ($output = mcrypt_create_iv($length, MCRYPT_DEV_URANDOM)) !== FALSE)
59
if
(is_readable(
'/dev/urandom'
) && ($fp = fopen(
'/dev/urandom'
,
'rb'
)) !== FALSE)
63
is_php(
'5.4'
) && stream_set_chunk_size($fp, $length);
65
$output = fread($fp, $length);
69
if
($output !== FALSE)
79
if
(function_exists(
'openssl_random_pseudo_bytes'
))
83
return
openssl_random_pseudo_bytes($length);
将以上代码粘贴到
/**
* 载入小助手,系统默认载入小助手
这段代码的上方即可。