Users: Changed name validation to min:1 instead of 2
Some checks failed
lint-php / build (push) Has been cancelled
test-migrations / build (8.1) (push) Has been cancelled
test-migrations / build (8.2) (push) Has been cancelled
test-migrations / build (8.3) (push) Has been cancelled
test-php / build (8.1) (push) Has been cancelled
test-php / build (8.2) (push) Has been cancelled
analyse-php / build (push) Has been cancelled
test-php / build (8.3) (push) Has been cancelled

Would cause scenarios where users could be created with 1 char, but then
fail to update due to validation differences.
Added test to cover.
For #5263
This commit is contained in:
Dan Brown
2024-10-15 11:07:41 +01:00
parent 4dc75bad05
commit 6f1c54d018
3 changed files with 13 additions and 4 deletions

View File

@ -144,7 +144,7 @@ class UserController extends Controller
$this->checkPermission('users-manage');
$validated = $this->validate($request, [
'name' => ['min:2', 'max:100'],
'name' => ['min:1', 'max:100'],
'email' => ['min:2', 'email', 'unique:users,email,' . $id],
'password' => ['required_with:password_confirm', Password::default()],
'password-confirm' => ['same:password', 'required_with:password'],