Signed-off-by: Christopher Ng <chrng8@gmail.com>
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;
* 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)) {