Skip to content

Commit

Permalink
chore(user): increase first and last name limit to 64
Browse files Browse the repository at this point in the history
  • Loading branch information
veselcraft authored Jan 17, 2025
1 parent aa2a163 commit 5048015
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Web/Models/Entities/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ function verifyNumber(string $code): bool
function setFirst_Name(string $firstName): void
{
$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;

$this->stateChanges("first_name", $firstName);
Expand All @@ -1069,7 +1069,7 @@ function setLast_Name(string $lastName): void
if(!empty($lastName))
{
$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;
}

Expand Down

0 comments on commit 5048015

Please sign in to comment.