织梦dedecms出现系统基本参数空白怎么办

织梦dedecms出现系统基本参数空白或显示Call to undefined function make_hash()

最新的织梦版本(2018-01-09)修改了include文件夹中的common.func.php增加了两个函数。

下载的模板文件夹中如果提供了common.func.php文件,很有可能没有这两个函数,于是会造成错误。

需要将这两个函数的代码粘贴到/include/common.func.php文件中,代码如下:

01function make_hash()
02 
03{
04 
05    $rand = dede_random_bytes(16);
06 
07    $_SESSION['token'] = ($rand === FALSE)
08 
09        ? md5(uniqid(mt_rand(), TRUE))
10 
11        : bin2hex($rand);
12 
13    return $_SESSION['token'];
14 
15}
16 
17function dede_random_bytes($length)
18 
19{
20 
21    if (empty($length) OR ! ctype_digit((string) $length))
22 
23    {
24 
25        return FALSE;
26 
27    }
28 
29    if (function_exists('random_bytes'))
30 
31    {
32 
33        try
34 
35        {
36 
37            return random_bytes((int) $length);
38 
39        }
40 
41        catch (Exception $e)
42 
43        {
44 
45            return FALSE;
46 
47        }
48 
49    }
50 
51    if (defined('MCRYPT_DEV_URANDOM') && ($output = mcrypt_create_iv($length, MCRYPT_DEV_URANDOM)) !== FALSE)
52 
53    {
54 
55        return $output;
56 
57    }
58 
59    if (is_readable('/dev/urandom') && ($fp = fopen('/dev/urandom''rb')) !== FALSE)
60 
61    {
62 
63        is_php('5.4') && stream_set_chunk_size($fp, $length);
64 
65        $output = fread($fp, $length);
66 
67        fclose($fp);
68 
69        if ($output !== FALSE)
70 
71        {
72 
73            return $output;
74 
75        }
76 
77    }
78 
79    if (function_exists('openssl_random_pseudo_bytes'))
80 
81    {
82 
83        return openssl_random_pseudo_bytes($length);
84 
85    }
86 
87    return FALSE;
88 
89}

 

将以上代码粘贴到

/**

* 载入小助手,系统默认载入小助手

这段代码的上方即可。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值