Skip to content

Commit

Permalink
fix(job): Check if carddata is resource and read it to string
Browse files Browse the repository at this point in the history
Fixes #46100

Co-authored-by: Christoph Wurst <[email protected]>
Signed-off-by: Mikhail Kotelnikov <[email protected]>
  • Loading branch information
2 people authored and backportbot[bot] committed Nov 19, 2024
1 parent ce3fb9a commit 9e6bb3c
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ private function buildIndex($offset, $stopAt) {
// 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) {
Expand Down

0 comments on commit 9e6bb3c

Please sign in to comment.