]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(user_ldap): Ignore unserialize error in group membership migration 43764/head
authorCôme Chilliet <come.chilliet@nextcloud.com>
Thu, 22 Feb 2024 12:39:10 +0000 (13:39 +0100)
committerCôme Chilliet <91878298+come-nc@users.noreply.github.com>
Wed, 6 Mar 2024 09:18:16 +0000 (10:18 +0100)
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 4e3e44a5f21da25861f06e0ae8d0f31f221ffcd6..e0740514d75f2806674d0ba97242b2f6416f449a 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 {