又是老生长谈的问题,升级(0901)版本造成的BUG。小编今天去康盛官方论坛“充电”又发现最新的一个BUG了。用户注册提示“邮箱、密码等无效”康盛给我们开了个国际玩笑,用户注册都能出问题,哎。不过站长们不要激动,不是所有升级到(0901)的版本都会出现这样的问题的。如果站长你更新后出现此问题,恭喜你“中枪了”。不要担心,小编已经帮各位站长整理好了解决方法往下看就知道如何解决了。
一、解决Discuz!X2.5(0901)后用户注册提示“邮箱、密码等无效”
1、通过FTP工具连接php虚拟主机文件目录为:…/source/function中的function_core.php(下载至本地电脑)
2、修改function_core.php(修改前请备份好)
通过文本编辑器(EditPlus)打开function_core.php
1 function random($length, $numeric = 0) {
2 $seed = base_convert(md5(microtime().$_SERVER['DOCUMENT_ROOT']), 16, $numeric ? 10 : 35);
3 $seed = $numeric ? (str_replace('0', '', $seed).'012340567890') : ($seed.'zZ'.strtoupper($seed));
4 $hash = '';
5 $max = strlen($seed) - 1;
6 for($i = 0; $i < $length; $i++) {
7 $hash .= $seed{mt_rand(0, $max)};
8 }
9 return $hash;
10 }
修改为:
1 function random($length, $numeric = 0) {
2 $seed = base_convert(md5(microtime().$_SERVER['DOCUMENT_ROOT']), 16, $numeric ? 10 : 35);
3 $seed = $numeric ? (str_replace('0', '', $seed).'012340567890') : ($seed.'zZ'.strtoupper($seed));
4 if($numeric) {
5 $hash = '';
6 } else {
7 $hash = chr(rand(1, 26) + rand(0, 1) * 32 + 64);
8 $length--;
9 }
10 $max = strlen($seed) - 1;
11 for($i = 0; $i < $length; $i++) {
12 $hash .= $seed{mt_rand(0, $max)};
13 }
14 return $hash;
15 }
温馨提示:如果改站升级后出现此问题可通过以上方法解决,此方法为临时解决方案。站长只有等待最新版本出来,把之前版本的BUG修补好。 |