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 <ChristophWurst@users.noreply.github.com>
Signed-off-by: Mikhail Kotelnikov <fox@woland.me>
  • Loading branch information
wolandtel and ChristophWurst committed Nov 19, 2024
1 parent 7ffbc81 commit e9d6c50
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,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 e9d6c50

Please sign in to comment.