chore(user): increase first and last name limit to 64

This commit is contained in:
Vladimir Barinov 2025-01-17 15:20:43 +03:00 committed by GitHub
parent aa2a1636df
commit 504801520b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1058,7 +1058,7 @@ class User extends RowModel
function setFirst_Name(string $firstName): void function setFirst_Name(string $firstName): void
{ {
$firstName = mb_convert_case($firstName, MB_CASE_TITLE); $firstName = mb_convert_case($firstName, MB_CASE_TITLE);
if(!preg_match('%^[\p{Lu}\p{Lo}]\p{Mn}?(?:[\p{L&}\p{Lo}]\p{Mn}?){1,16}$%u', $firstName)) if(!preg_match('%^[\p{Lu}\p{Lo}]\p{Mn}?(?:[\p{L&}\p{Lo}]\p{Mn}?){1,64}$%u', $firstName))
throw new InvalidUserNameException; throw new InvalidUserNameException;
$this->stateChanges("first_name", $firstName); $this->stateChanges("first_name", $firstName);
@ -1069,7 +1069,7 @@ class User extends RowModel
if(!empty($lastName)) if(!empty($lastName))
{ {
$lastName = mb_convert_case($lastName, MB_CASE_TITLE); $lastName = mb_convert_case($lastName, MB_CASE_TITLE);
if(!preg_match('%^[\p{Lu}\p{Lo}]\p{Mn}?([\p{L&}\p{Lo}]\p{Mn}?){1,16}(\-\g<1>+)?$%u', $lastName)) if(!preg_match('%^[\p{Lu}\p{Lo}]\p{Mn}?([\p{L&}\p{Lo}]\p{Mn}?){1,64}(\-\g<1>+)?$%u', $lastName))
throw new InvalidUserNameException; throw new InvalidUserNameException;
} }