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

[复制链接]
查看1907 | 回复3 | 2020-8-6 01:49:42 | 显示全部楼层 |阅读模式
最新的织梦版本(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; } 将以上代码粘贴到   /**  *  载入小助手,系统默认载入小助手 这段代码的上方即可。织梦cms建站教程从入门到精通,自由织梦网www.freedede.cn长期免费更新教程,图文结合dedecms建站教程经验,内容包含使用织 梦CMS、做模板、写采集规则、做插件模块,是学习织梦产品的最佳去处。
回复

使用道具 举报

匣中剑他娘官 | 2021-3-27 08:16:28 | 显示全部楼层
这个下载站资源真齐全
回复

使用道具 举报

明功 | 2022-7-29 19:39:12 | 显示全部楼层
我是来白嫖悟空源码的积分的!!!!!
回复

使用道具 举报

半岛宫殿rw | 2023-3-27 03:10:55 | 显示全部楼层
6666悟空源码资源多!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则