]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(job): Check if carddata is resource and read it to string backport/49332/stable30 49400/head
authorMikhail Kotelnikov <fox@woland.me>
Sat, 16 Nov 2024 06:20:43 +0000 (11:20 +0500)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Wed, 20 Nov 2024 11:34:16 +0000 (11:34 +0000)
Fixes nextcloud/server#46100

Co-authored-by: Christoph Wurst <ChristophWurst@users.noreply.github.com>
Signed-off-by: Mikhail Kotelnikov <fox@woland.me>
apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php

index 138f764f1e6c05bea522f4a2d12de946b2345233..f727f4ea09a7dd82bc0d19a3e5070bc809b88d5e 100644 (file)
@@ -71,7 +71,11 @@ class BuildSocialSearchIndexBackgroundJob extends QueuedJob {
                // refresh identified contacts in order to re-index
                foreach ($social_cards as $contact) {
                        $offset = $contact['id'];
-                       $this->davBackend->updateCard($contact['addressbookid'], $contact['uri'], $contact['carddata']);
+                       $cardData = $contact['carddata'];
+                       if (is_resource($cardData) && (get_resource_type($cardData) === 'stream')) {
+                               $cardData = stream_get_contents($cardData);
+                       }
+                       $this->davBackend->updateCard($contact['addressbookid'], $contact['uri'], $cardData);
 
                        // stop after 15sec (to be continued with next chunk)
                        if (($this->time->getTime() - $startTime) > 15) {