mirror of
https://github.com/flarum/core.git
synced 2025-07-23 09:41:26 +02: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:
@@ -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'
|
||||||
|
Reference in New Issue
Block a user