1:修改uc_client\model\user.php
function check_username($username) {
$charset = strtolower(UC_CHARSET);
if ($charset === 'utf-8') {
$guestexp = '\xE3\x80\x80|\xE6\xB8\xB8\xE5\xAE\xA2|\xE9\x81\x8A\xE5\xAE\xA2';
} elseif ($charset === 'gbk') {
$guestexp = '\xA1\xA1|\xD3\xCE\xBF\xCD';
} elseif ($charset === 'big5') {
$guestexp = '\xA1\x40|\xB9\x43\xAB\xC8';
} else {
return FALSE;
}
$guestexp .= '|^Guest';
$len = $this->dstrlen($username);
if($len > 15 || $len < 3 || !(preg_match("/^([a-zA-z0-9])+$/u",$username)) || preg_match("/\s+|^c:\\con\\con|[%,\*\"\s\<\>\&\(\)']|$guestexp/is", $username)) {
return FALSE;
} else {
return TRUE;
}
}
2:修改source\language\lang_message.php
在229行左右加 一个错误消息
'profile_username_tooshort' => '抱歉,您输入的用户名小于 3 个字符,请输入一个较长的用户名',
添加-> 'profile_username_notallchinese' => '抱歉,用户名必须是英文或者数字组合',
'profile_username_toolong' => '抱歉,您的用户名超过 15 个字符,请输入一个较短的用户名', 3:source\module\forum\forum_ajax.php
在20行左右加一个判断
if($usernamelen < 3) {
showmessage('profile_username_tooshort', '', array(), array('handle' => false));
} elseif($usernamelen > 15) {
showmessage('profile_username_toolong', '', array(), array('handle' => false));
}
添加-> if(!(preg_match("/^([a-zA-z0-9])+$/u",$username))) {
showmessage('profile_username_notallchinese', '', array(), array('handle' => false));
}
4:source\class\class_member.php
在581行左右加一个判断
if($usernamelen < 3) {
showmessage('profile_username_tooshort');
} elseif($usernamelen > 15) {
showmessage('profile_username_toolong');
}
添加-> if(!(preg_match("/^([a-zA-z0-9])+$/u",,$username))) {
showmessage('profile_username_notallchinese');
}
|