Merge pull request #49388 from nextcloud/backport/49332/stable28

[stable28] fix(job): Check if carddata is resource and read it to string
pull/49446/head
Git'Fellow 2024-11-21 05:44:37 +07:00 committed by GitHub
commit 03300aec8f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

@ -110,7 +110,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->timeFactory->getTime() - $startTime) > 15) {