]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(user_ldap): Ignore unserialize error in group membership migration 44030/head
authorCôme Chilliet <come.chilliet@nextcloud.com>
Thu, 22 Feb 2024 12:39:10 +0000 (13:39 +0100)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Wed, 6 Mar 2024 12:05:32 +0000 (12:05 +0000)
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 <come.chilliet@nextcloud.com>
apps/user_ldap/lib/Migration/Version1190Date20230706134108.php

index 71fdb536b1af3e00c3231216851dcbcf6f10dfab..8e4c92598da94d27fefcac9acb1ceb4406a53ad4 100644 (file)
@@ -99,6 +99,10 @@ class Version1190Date20230706134108 extends SimpleMigrationStep {
                $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 {