Validation for illegal characters

This commit is contained in:
Julian Prieber 2024-02-07 01:00:11 +01:00
parent 9b63ad9820
commit 85fecf2222
1 changed files with 2 additions and 2 deletions

View File

@ -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',
]);