From 85fecf2222f2ebf5683cb4bafd806cc2cb30f24c Mon Sep 17 00:00:00 2001 From: Julian Prieber Date: Wed, 7 Feb 2024 01:00:11 +0100 Subject: [PATCH] Validation for illegal characters --- app/Http/Controllers/Auth/RegisteredUserController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Auth/RegisteredUserController.php b/app/Http/Controllers/Auth/RegisteredUserController.php index 4b0b700..3d15ebe 100755 --- a/app/Http/Controllers/Auth/RegisteredUserController.php +++ b/app/Http/Controllers/Auth/RegisteredUserController.php @@ -24,7 +24,7 @@ class RegisteredUserController extends Controller public function validateHandle(Request $request) { $validator = Validator::make($request->all(), [ - 'littlelink_name' => 'required|string|max:50|unique:users', + 'littlelink_name' => 'required|string|max:50|unique:users|regex:/^[\p{L}0-9-_]+$/u', ]); if ($validator->fails()) { @@ -38,7 +38,7 @@ class RegisteredUserController extends Controller { $request->validate([ 'name' => 'required|string|max:255', - 'littlelink_name' => 'required|string|max:50|unique:users', + 'littlelink_name' => 'required|string|max:50|unique:users|regex:/^[\p{L}0-9-_]+$/u', 'email' => 'required|string|email|max:255|unique:users', 'password' => 'required|string|min:8', ]);