diff options
author | Christopher Ng <chrng8@gmail.com> | 2022-06-28 18:03:15 +0000 |
---|---|---|
committer | Christopher Ng <chrng8@gmail.com> | 2022-06-28 18:03:15 +0000 |
commit | c0868f93f1175c32379f6e64b245b724c40478be (patch) | |
tree | 954777bd8f9109e3a2a6412fc54903a5551a4b6e /apps/provisioning_api | |
parent | a1bc7700439c6f06842d42e67a0474de9faef34d (diff) | |
download | nextcloud-server-c0868f93f1175c32379f6e64b245b724c40478be.tar.gz nextcloud-server-c0868f93f1175c32379f6e64b245b724c40478be.zip |
Do not save invalid display name to the database
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Diffstat (limited to 'apps/provisioning_api')
-rw-r--r-- | apps/provisioning_api/lib/Controller/UsersController.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php index a26479ba0a8..839ac404c94 100644 --- a/apps/provisioning_api/lib/Controller/UsersController.php +++ b/apps/provisioning_api/lib/Controller/UsersController.php @@ -837,7 +837,9 @@ class UsersController extends AUserData { switch ($key) { case self::USER_FIELD_DISPLAYNAME: case IAccountManager::PROPERTY_DISPLAYNAME: - $targetUser->setDisplayName($value); + if (!$targetUser->setDisplayName($value)) { + throw new OCSException('Invalid displayname', 102); + } break; case self::USER_FIELD_QUOTA: $quota = $value; |