Skip to content

Commit fe19f3c

Browse files
Merge pull request #55079 from nextcloud/fix/displayname-migration-25
[stable25] fix(ownCloud): ensure that `accounts.display_name` fits into `users.displayname`
2 parents b1e8c76 + 78d74d1 commit fe19f3c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/private/Repair/Owncloud/SaveAccountsTableData.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,8 @@ protected function migrateUserInfo(IQueryBuilder $update, $userdata) {
191191
}
192192

193193
if ($userdata['display_name'] !== null) {
194-
$update->setParameter('displayname', $userdata['display_name'])
194+
// user.displayname only allows 64 characters but old accounts.display_name allowed 255 characters
195+
$update->setParameter('displayname', mb_substr($userdata['display_name'], 0, 64))
195196
->setParameter('userid', $userdata['user_id']);
196197
$update->execute();
197198
}

0 commit comments

Comments
 (0)