Skip to content

Commit 824536d

Browse files
authored
Merge pull request #49400 from nextcloud/backport/49332/stable30
[stable30] fix(job): Check if carddata is resource and read it to string
2 parents 3f6d5c1 + b94f396 commit 824536d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ private function buildIndex($offset, $stopAt) {
7171
// refresh identified contacts in order to re-index
7272
foreach ($social_cards as $contact) {
7373
$offset = $contact['id'];
74-
$this->davBackend->updateCard($contact['addressbookid'], $contact['uri'], $contact['carddata']);
74+
$cardData = $contact['carddata'];
75+
if (is_resource($cardData) && (get_resource_type($cardData) === 'stream')) {
76+
$cardData = stream_get_contents($cardData);
77+
}
78+
$this->davBackend->updateCard($contact['addressbookid'], $contact['uri'], $cardData);
7579

7680
// stop after 15sec (to be continued with next chunk)
7781
if (($this->time->getTime() - $startTime) > 15) {

0 commit comments

Comments
 (0)