mirror of
https://github.com/openvk/openvk
synced 2025-01-09 17:29:42 +03:00
Allow non-cased letters in names
This commit is contained in:
parent
8377dc733d
commit
881665831e
1 changed files with 2 additions and 2 deletions
|
@ -743,7 +743,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{Mn}?(?:\p{L&}\p{Mn}?){1,16}$%u', $firstName))
|
if(!preg_match('%^[\p{Lu}\p{Lo}]\p{Mn}?(?:[\p{L&}\p{Lo}]\p{Mn}?){1,16}$%u', $firstName))
|
||||||
throw new InvalidUserNameException;
|
throw new InvalidUserNameException;
|
||||||
|
|
||||||
$this->stateChanges("first_name", $firstName);
|
$this->stateChanges("first_name", $firstName);
|
||||||
|
@ -754,7 +754,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{Mn}?(\p{L&}\p{Mn}?){1,16}(\-\g<1>+)?$%u', $lastName))
|
if(!preg_match('%^[\p{Lu}\p{Lo}]\p{Mn}?([\p{L&}\p{Lo}]\p{Mn}?){1,16}(\-\g<1>+)?$%u', $lastName))
|
||||||
throw new InvalidUserNameException;
|
throw new InvalidUserNameException;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue