修改用户名长度和规则判断的正则表达式

This commit is contained in:
Li Jianxuan 2013-12-27 06:21:12 +00:00
parent dd22a0fe70
commit f6b1acc273
1 changed files with 1 additions and 1 deletions

View File

@ -45,7 +45,7 @@ class RegisterOperate implements \Users\Event\RegisterEvent
if(!empty($data['username']))
{
if(!preg_match("/^[a-zA-Z\xa0-\xff_][0-9a-zA-Z\xa0-\xff_]{2,25}$/",$data['username']))
if(!preg_match("/[0-9a-zA-Z\xa0-\xff_]{2,25}/",$data['username']))
{
return array('error'=>"用户名只能包含字母汉字数字和下划线并且长度在2到26个字符之间",'place'=>'username');
}