From 875d0a27b0f11d0a4027bc1d5f7eae1afcd8aa59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Thu, 22 Feb 2024 13:39:10 +0100 Subject: [PATCH] fix(user_ldap): Ignore unserialize error in group membership migration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The memberships will be checked by the background job later and data will be added to the table anyway. Signed-off-by: Côme Chilliet --- .../user_ldap/lib/Migration/Version1190Date20230706134108.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/user_ldap/lib/Migration/Version1190Date20230706134108.php b/apps/user_ldap/lib/Migration/Version1190Date20230706134108.php index 4e3e44a5f21da..e0740514d75f2 100644 --- a/apps/user_ldap/lib/Migration/Version1190Date20230706134108.php +++ b/apps/user_ldap/lib/Migration/Version1190Date20230706134108.php @@ -99,6 +99,10 @@ protected function copyGroupMembershipData(): void { $result = $query->executeQuery(); while ($row = $result->fetch()) { $knownUsers = unserialize($row['owncloudusers']); + if (!is_array($knownUsers)) { + /* Unserialize failed or data was incorrect in database, ignore */ + continue; + } $knownUsers = array_unique($knownUsers); foreach ($knownUsers as $knownUser) { try {