修改用户名长度和规则判断的正则表达式
This commit is contained in:
parent
dd22a0fe70
commit
f6b1acc273
|
@ -45,7 +45,7 @@ class RegisterOperate implements \Users\Event\RegisterEvent
|
||||||
|
|
||||||
if(!empty($data['username']))
|
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');
|
return array('error'=>"用户名只能包含字母汉字数字和下划线,并且长度在2到26个字符之间",'place'=>'username');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue