织梦dedecms呈现零碎根本参数空缺怎样办?
织梦dedecms呈现零碎根本参数空缺或显示Call to undefined function make_hash()
保举学习:织梦cms
最新的织梦版本(2018-01-09)修正了include文件夹中的co妹妹on.func.php,添加了两个函数。
下载的模板文件夹中假如提供了co妹妹on.func.php文件,颇有可能不这两个函数,于是会造成谬误。
需求将这两个函数的代码粘贴到/include/co妹妹on.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教程 dede问题解决
版权声明:除非特别标注,否则均为本站原创文章,转载时请以链接形式注明文章出处。