]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(job): Check if carddata is resource and read it to string backport/49332/stable29 49389/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>
Tue, 19 Nov 2024 18:31:18 +0000 (18:31 +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 9881d2903cbc57d794cc4973bbb40214a9635e2b..873f3a063ebe92477aa68aa11c295dafec99183f 100644 (file)
@@ -89,7 +89,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) {