From 840fba1a5afcad0f4f52e6613011a05acb20d347 Mon Sep 17 00:00:00 2001 From: "Simon L." Date: Tue, 29 Jul 2025 11:17:51 +0200 Subject: [PATCH] fix(BuildSocialSearchIndexBackgroundJob): ensure that special characters are handled correctly Signed-off-by: Simon L. --- apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php b/apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php index fab61d56fd690..2f52729648ed4 100644 --- a/apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php +++ b/apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php @@ -15,6 +15,7 @@ use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IDBConnection; use Psr\Log\LoggerInterface; +use Sabre\DAV; class BuildSocialSearchIndexBackgroundJob extends QueuedJob { public function __construct( @@ -75,6 +76,8 @@ private function buildIndex($offset, $stopAt) { if (is_resource($cardData) && (get_resource_type($cardData) === 'stream')) { $cardData = stream_get_contents($cardData); } + // Converting to UTF-8, if needed + $cardData = DAV\StringUtil::ensureUTF8($cardData); $this->davBackend->updateCard($contact['addressbookid'], $contact['uri'], $cardData); // stop after 15sec (to be continued with next chunk)