summaryrefslogtreecommitdiffstats
path: root/apps/provisioning_api
diff options
context:
space:
mode:
authorChristopher Ng <chrng8@gmail.com>2022-06-28 18:03:15 +0000
committerChristopher Ng <chrng8@gmail.com>2022-06-28 18:03:15 +0000
commitc0868f93f1175c32379f6e64b245b724c40478be (patch)
tree954777bd8f9109e3a2a6412fc54903a5551a4b6e /apps/provisioning_api
parenta1bc7700439c6f06842d42e67a0474de9faef34d (diff)
downloadnextcloud-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.php4
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;