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

织梦dedecms出现系统基本参数空白怎么办 - 我爱模板网

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

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

推荐学习:织梦cms

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

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

需要将这两个函数的代码粘贴到/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'];
}
function dede_random_bytes($length)
{
    if (empty($length) OR ! ctype_digit((string) $length))
    {
        return FALSE;
    }
    if (function_exists('random_bytes'))
    {
        try
        {
            return random_bytes((int) $length);
        }
        catch (Exception $e)
        {
            return FALSE;
        }
    }
    if (defined('MCRYPT_DEV_URANDOM') && ($output = mcrypt_create_iv($length, MCRYPT_DEV_URANDOM)) !== FALSE)
    {
        return $output;
    }
    if (is_readable('/dev/urandom') && ($fp = fopen('/dev/urandom', 'rb')) !== FALSE)
    {
        is_php('5.4') && stream_set_chunk_size($fp, $length);
        $output = fread($fp, $length);
        fclose($fp);
        if ($output !== FALSE)
        {
            return $output;
        }
    }
    if (function_exists('openssl_random_pseudo_bytes'))
    {
        return openssl_random_pseudo_bytes($length);
    }
    return FALSE;
}
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。

给TA打赏
共{{data.count}}人
人已打赏
DEDECMS教程

dedecms怎么解决rss相对路径问题

2024-4-26 11:12:09

DEDECMS教程

织梦核心类TypeLink.class.php是什么

2024-4-26 12:02:33

!
你也想出现在这里?立即 联系我们吧!
信息
0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
搜索