summaryrefslogtreecommitdiffstats
path: root/core/Command
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 /core/Command
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 'core/Command')
-rw-r--r--core/Command/Group/Add.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/Command/Group/Add.php b/core/Command/Group/Add.php
index eb2ecd0c533..f2ee6195a44 100644
--- a/core/Command/Group/Add.php
+++ b/core/Command/Group/Add.php
@@ -70,8 +70,9 @@ class Add extends Base {
$group = $this->groupManager->createGroup($gid);
$output->writeln('Created group "' . $group->getGID() . '"');
- if ($input->hasOption('display-name')) {
- $group->setDisplayName($input->getOption('display-name'));
+ $displayName = trim((string) $input->getOption('display-name'));
+ if ($displayName !== '') {
+ $group->setDisplayName($displayName);
}
}
}