summaryrefslogtreecommitdiffstats
path: root/lib/private/User/Database.php
diff options
context:
space:
mode:
authorChristopher Ng <chrng8@gmail.com>2022-08-19 20:02:57 +0000
committerChristopher Ng <chrng8@gmail.com>2022-08-22 19:13:11 +0000
commitd59585974e2f3f51598da31f6e1dd0684affa77b (patch)
tree13cdd86687f7aba4f4c65b81d81b06b2ba982c7f /lib/private/User/Database.php
parent2576609aac3555da0926c27b879df610a8b0f43c (diff)
downloadnextcloud-server-d59585974e2f3f51598da31f6e1dd0684affa77b.tar.gz
nextcloud-server-d59585974e2f3f51598da31f6e1dd0684affa77b.zip
Fix creation of new user and display the correct error message
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Diffstat (limited to 'lib/private/User/Database.php')
-rw-r--r--lib/private/User/Database.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/private/User/Database.php b/lib/private/User/Database.php
index 0b38f04bfe3..f106c2e8b6d 100644
--- a/lib/private/User/Database.php
+++ b/lib/private/User/Database.php
@@ -212,11 +212,13 @@ class Database extends ABackend implements
* @param string $displayName The new display name
* @return bool
*
+ * @throws \InvalidArgumentException
+ *
* Change the display name of a user
*/
public function setDisplayName(string $uid, string $displayName): bool {
if (mb_strlen($displayName) > 64) {
- return false;
+ throw new \InvalidArgumentException('Invalid displayname');
}
$this->fixDI();