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-20 11:34:16 +0000 |
commit | b94f396c4fb6b0eb55c3cb768ff36e624ea43d9c (patch) | |
tree | 95af2abd69c7f477f806ef85ac7872e90e6c051d /apps | |
parent | 14f3dbefbb7b38f609be906a023a8b99318ee38f (diff) | |
download | nextcloud-server-b94f396c4fb6b0eb55c3cb768ff36e624ea43d9c.tar.gz nextcloud-server-b94f396c4fb6b0eb55c3cb768ff36e624ea43d9c.zip |
fix(job): Check if carddata is resource and read it to stringbackport/49332/stable30
Fixes nextcloud/server#46100
Co-authored-by: Christoph Wurst <ChristophWurst@users.noreply.github.com>
Signed-off-by: Mikhail Kotelnikov <fox@woland.me>
Diffstat (limited to 'apps')
-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 138f764f1e6..f727f4ea09a 100644 --- a/apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php +++ b/apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php @@ -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) { |