Skip to content

Commit 74c0676

Browse files
committed
chore(user): change regex for set*_Name
1 parent 2b01f26 commit 74c0676

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Web/Models/Entities/User.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,7 @@ public function verifyNumber(string $code): bool
11721172
public function setFirst_Name(string $firstName): void
11731173
{
11741174
$firstName = mb_convert_case($firstName, MB_CASE_TITLE);
1175-
if (!preg_match('%^[\p{Lu}\p{Lo}]\p{Mn}?(?:[\p{L&}\p{Lo}]\p{Mn}?){1,64}$%u', $firstName)) {
1175+
if (!preg_match('%^[\p{Lu}\p{Lo}]\p{Mn}?(?:[\p{L&}\p{Lo}-.]\p{Mn}?){1,64}$%u', $firstName)) {
11761176
throw new InvalidUserNameException();
11771177
}
11781178

@@ -1183,7 +1183,7 @@ public function setLast_Name(string $lastName): void
11831183
{
11841184
if (!empty($lastName)) {
11851185
$lastName = mb_convert_case($lastName, MB_CASE_TITLE);
1186-
if (!preg_match('%^[\p{Lu}\p{Lo}]\p{Mn}?([\p{L&}\p{Lo}]\p{Mn}?){1,64}(\-\g<1>+)?$%u', $lastName)) {
1186+
if (!preg_match('%^[\p{Lu}\p{Lo}]\p{Mn}?([\p{L&}\p{Lo}-.]\p{Mn}?){0,64}(\-\g<1>+)?$%u', $lastName)) {
11871187
throw new InvalidUserNameException();
11881188
}
11891189
}

0 commit comments

Comments
 (0)