Skip to content

Commit 78d74d1

Browse files
committed
fix(ownCloud): ensure that accounts.display_name fits into users.displayname
- manual backport of #55006 Needed because we recommend to do migrations from OC 10.x to NC 25 ... Signed-off-by: Ferdinand Thiessen <[email protected]>
1 parent b1e8c76 commit 78d74d1

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)