mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-05-18 14:21:05 +00:00
Set a fairly sensible limit on user name validation
Also updated controller properties with types within modified files. Related to #3614
This commit is contained in:
parent
89ec9a5081
commit
4209f27f1a
3 changed files with 10 additions and 10 deletions
app/Http/Controllers
|
@ -18,8 +18,8 @@ use Illuminate\Validation\ValidationException;
|
|||
|
||||
class UserController extends Controller
|
||||
{
|
||||
protected $userRepo;
|
||||
protected $imageRepo;
|
||||
protected UserRepo $userRepo;
|
||||
protected ImageRepo $imageRepo;
|
||||
|
||||
/**
|
||||
* UserController constructor.
|
||||
|
@ -81,7 +81,7 @@ class UserController extends Controller
|
|||
$passwordRequired = ($authMethod === 'standard' && !$sendInvite);
|
||||
|
||||
$validationRules = [
|
||||
'name' => ['required'],
|
||||
'name' => ['required', 'max:100'],
|
||||
'email' => ['required', 'email', 'unique:users,email'],
|
||||
'language' => ['string', 'max:15', 'alpha_dash'],
|
||||
'roles' => ['array'],
|
||||
|
@ -139,7 +139,7 @@ class UserController extends Controller
|
|||
$this->checkPermissionOrCurrentUser('users-manage', $id);
|
||||
|
||||
$validated = $this->validate($request, [
|
||||
'name' => ['min:2'],
|
||||
'name' => ['min:2', 'max:100'],
|
||||
'email' => ['min:2', 'email', 'unique:users,email,' . $id],
|
||||
'password' => ['required_with:password_confirm', Password::default()],
|
||||
'password-confirm' => ['same:password', 'required_with:password'],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue