mirror of
https://github.com/flarum/framework.git
synced 2024-12-11 21:43:38 +08:00
Use regex for username validation
Laravel's alpha_dash rule allows unicode letters including those with inflections, leading to issues like #832. As per discussion in #557, we are sticking with ASCII-only usernames for now.
This commit is contained in:
parent
bc95ab8ae1
commit
b461f157ca
|
@ -45,7 +45,7 @@ class UserValidator extends AbstractValidator
|
||||||
return [
|
return [
|
||||||
'username' => [
|
'username' => [
|
||||||
'required',
|
'required',
|
||||||
'alpha_dash',
|
'regex:/^[a-z0-9_-]+$/i',
|
||||||
'unique:users,username'.$idSuffix,
|
'unique:users,username'.$idSuffix,
|
||||||
'min:3',
|
'min:3',
|
||||||
'max:30'
|
'max:30'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user