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

导读:织梦dedecms出现系统基本参数空白怎么办? 织梦dedecms出现系统基本参数空白或显示Call to undefined function make_h

织梦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;
}

将以上代码粘贴到

/**

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

这段代码的上方即可。

以上就是织梦dedecms出现系统基本参数空白怎么办的详细内容,更多请关注本网内其它相关文章!

你也想0元试听小码王编程课程吗?
填写信息免费预约
免责申明:以上展示内容来源于合作媒体、企业机构、网友提供或网络收集整理,版权争议与本站无关,文章涉及见解与观点不代表小码王官方立场,请读者仅做参考。本文标题:织梦dedecms出现系统基本参数空白怎么办,本文链接:https://www.xiaomawang.cn/help/212957.html;欢迎转载,转载请说明出处。若您认为本文侵犯了您的版权信息,或您发现该内容有任何涉及有违公德、触犯法律等违法信息,请您立即通过邮件(邮箱号:)联系我们及时修正或删除。
校区接待前厅
校区太空走廊
校区教室环境
校区多功能教室
小码王少儿编程体验课程免费预约