Skip to content

Commit

Permalink
Merge pull request #49389 from nextcloud/backport/49332/stable29
Browse files Browse the repository at this point in the history
[stable29] fix(job): Check if carddata is resource and read it to string
  • Loading branch information
solracsf authored Nov 21, 2024
2 parents 947890f + 89d43ac commit fbbe845
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,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->time->getTime() - $startTime) > 15) {
Expand Down

0 comments on commit fbbe845

Please sign in to comment.