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
|
@ -750,10 +750,13 @@ class User extends RowModel
|
|||
}
|
||||
|
||||
function setLast_Name(string $lastName): void
|
||||
{
|
||||
if(!empty($lastName))
|
||||
{
|
||||
$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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue