diff options
author | Mikhail Kotelnikov <fox@woland.me> | 2024-11-16 11:20:43 +0500 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2024-11-19 18:29:36 +0000 |
commit | 9e6bb3c5a8fa2fad5f7ac9721505806d27444801 (patch) | |
tree | 9088a3b27f386fbbe4dce778d7c7a4b0a978a0ce | |
parent | ce3fb9a7d9038fa7a07941fa1cfb72f5fe23c6c9 (diff) | |
download | nextcloud-server-backport/49332/stable28.tar.gz nextcloud-server-backport/49332/stable28.zip |
fix(job): Check if carddata is resource and read it to stringbackport/49332/stable28
Fixes nextcloud/server#46100
Co-authored-by: Christoph Wurst <ChristophWurst@users.noreply.github.com>
Signed-off-by: Mikhail Kotelnikov <fox@woland.me>
-rw-r--r-- | apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php b/apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php index 05ad95c595c..65786c044fe 100644 --- a/apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php +++ b/apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php @@ -110,7 +110,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->timeFactory->getTime() - $startTime) > 15) { |