]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(job): Check if carddata is resource and read it to string 49332/head
authorMikhail Kotelnikov <fox@woland.me>
Sat, 16 Nov 2024 06:20:43 +0000 (11:20 +0500)
committerJohn Fox Woland <fox@woland.me>
Tue, 19 Nov 2024 17:28:27 +0000 (22:28 +0500)
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 072a4feacc62ed78e09c5d51d8777df132767e36..fab61d56fd690d66532cd79b40b106e6191c074f 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) {