Skip to content

Commit f0ce856

Browse files
committed
fix(BuildSocialSearchIndexBackgroundJob): ensure that special characters are handled correctly
Signed-off-by: Simon L. <szaimen@e.mail.de>
1 parent b8ad6d0 commit f0ce856

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use OCP\DB\QueryBuilder\IQueryBuilder;
1616
use OCP\IDBConnection;
1717
use Psr\Log\LoggerInterface;
18+
use Sabre\DAV;
1819

1920
class BuildSocialSearchIndexBackgroundJob extends QueuedJob {
2021
public function __construct(
@@ -75,6 +76,8 @@ private function buildIndex($offset, $stopAt) {
7576
if (is_resource($cardData) && (get_resource_type($cardData) === 'stream')) {
7677
$cardData = stream_get_contents($cardData);
7778
}
79+
// Converting to UTF-8, if needed
80+
$cardData = DAV\StringUtil::ensureUTF8($cardData);
7881
$this->davBackend->updateCard($contact['addressbookid'], $contact['uri'], $cardData);
7982

8083
// stop after 15sec (to be continued with next chunk)

0 commit comments

Comments
 (0)