aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2019-09-27 14:28:54 +0200
committerJoas Schilling <coding@schilljs.com>2019-09-27 14:29:57 +0200
commitb9f963225ff646eabd9c6cd1bb6799eba99d3c79 (patch)
tree04485e47d7f343de17bdfa9ca0452f7797610c44 /lib
parent704c7b6672cc0e0a7fb4ef7ed7b172999049b355 (diff)
downloadnextcloud-server-b9f963225ff646eabd9c6cd1bb6799eba99d3c79.tar.gz
nextcloud-server-b9f963225ff646eabd9c6cd1bb6799eba99d3c79.zip
Do not allow to have an empty display name
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Group/Database.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/private/Group/Database.php b/lib/private/Group/Database.php
index 21febce8e66..a616146db6d 100644
--- a/lib/private/Group/Database.php
+++ b/lib/private/Group/Database.php
@@ -109,6 +109,7 @@ class Database extends ABackend
$builder = $this->dbConn->getQueryBuilder();
$result = $builder->insert('groups')
->setValue('gid', $builder->createNamedParameter($gid))
+ ->setValue('displayname', $builder->createNamedParameter($gid))
->execute();
} catch(UniqueConstraintViolationException $e) {
$result = 0;
@@ -451,6 +452,11 @@ class Database extends ABackend
$this->fixDI();
+ $displayName = trim($displayName);
+ if ($displayName === '') {
+ $displayName = $gid;
+ }
+
$query = $this->dbConn->getQueryBuilder();
$query->update('groups')
->set('displayname', $query->createNamedParameter($displayName))