mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 09:13:19 -04:00
fix(job): Check if carddata is resource and read it to string
Fixes nextcloud/server#46100 Co-authored-by: Christoph Wurst <ChristophWurst@users.noreply.github.com> Signed-off-by: Mikhail Kotelnikov <fox@woland.me>
This commit is contained in:
parent
14f3dbefbb
commit
b94f396c4f
1 changed files with 5 additions and 1 deletions
|
|
@ -71,7 +71,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->time->getTime() - $startTime) > 15) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue