mirror of
https://github.com/openvk/openvk
synced 2024-11-11 01:19:53 +03:00
Users: Bring back ability to NOT set the last names
This commit is contained in:
parent
33df6ef170
commit
47093f40cc
1 changed files with 6 additions and 3 deletions
|
@ -751,9 +751,12 @@ class User extends RowModel
|
||||||
|
|
||||||
function setLast_Name(string $lastName): void
|
function setLast_Name(string $lastName): void
|
||||||
{
|
{
|
||||||
$lastName = mb_convert_case($lastName, MB_CASE_TITLE);
|
if(!empty($lastName))
|
||||||
if(!preg_match('%^\p{Lu}\p{Mn}?(\p{L&}\p{Mn}?){1,16}(\-\g<1>+)?$%u', $lastName))
|
{
|
||||||
throw new InvalidUserNameException;
|
$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))
|
||||||
|
throw new InvalidUserNameException;
|
||||||
|
}
|
||||||
|
|
||||||
$this->stateChanges("last_name", $lastName);
|
$this->stateChanges("last_name", $lastName);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue