aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav
diff options
context:
space:
mode:
authorMikhail Kotelnikov <fox@woland.me>2024-11-16 11:20:43 +0500
committerJohn Fox Woland <fox@woland.me>2024-11-19 22:28:27 +0500
commite9d6c501707dc45badc50d0c7fa0a8948a571285 (patch)
tree866ab1bb0bf6ff97674722db28559b6d77dc36da /apps/dav
parent7ffbc81b7f85ff4aec6e9364c0545528ca99726d (diff)
downloadnextcloud-server-e9d6c501707dc45badc50d0c7fa0a8948a571285.tar.gz
nextcloud-server-e9d6c501707dc45badc50d0c7fa0a8948a571285.zip
fix(job): Check if carddata is resource and read it to string
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/dav')
-rw-r--r--apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php b/apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php
index 072a4feacc6..fab61d56fd6 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) {