欢迎来到工商注册核名查询系统!

dedecms

当前位置:主页 > CMS教程 > dedecms >

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

来源:本站原创|时间:2022-11-25|栏目:dedecms|

最新的织梦版本(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;
}
将以上代码粘贴到
 
/**  *  载入小助手,系统默认载入小助手 这段代码的上方即可。

上一篇:DedeCMS让后台模板列表按字母排序方法

栏    目:dedecms

下一篇:dedecms判断栏目是否有下级菜单

更多dedecms

您可能感兴趣的文章

阅读排行

本栏相关

随机阅读

网页制作CMS教程网络编程软件编程脚本语言数据库服务器

如果侵犯了您的权利,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

联系QQ:835971066 | 邮箱:835971066#qq.com(#换成@)

Copyright © 2002-2020 工商注册核名查询系统 版权所有