summaryrefslogtreecommitdiffstats
path: root/lib/private
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 /lib/private
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 'lib/private')
-rw-r--r--lib/private/User/Database.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/private/User/Database.php b/lib/private/User/Database.php
index 4821a2fc632..fce7551c242 100644
--- a/lib/private/User/Database.php
+++ b/lib/private/User/Database.php
@@ -215,6 +215,10 @@ class Database extends ABackend implements
* Change the display name of a user
*/
public function setDisplayName(string $uid, string $displayName): bool {
+ if (mb_strlen($displayName) > 64) {
+ return false;
+ }
+
$this->fixDI();
if ($this->userExists($uid)) {