From 5c6f916009809578b806adaf504c0d45adbfa75d Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Thu, 5 Apr 2018 22:26:38 +0200 Subject: [PATCH] Use multibyte substring Fixes #7661 Signed-off-by: Roeland Jago Douma --- apps/dav/lib/CalDAV/CalDavBackend.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php index 191e9f1ac9..0a28ed2ede 100644 --- a/apps/dav/lib/CalDAV/CalDavBackend.php +++ b/apps/dav/lib/CalDAV/CalDavBackend.php @@ -2029,7 +2029,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription if (!$this->db->supports4ByteText()) { $value = preg_replace('/[\x{10000}-\x{10FFFF}]/u', "\xEF\xBF\xBD", $value); } - $value = substr($value, 0, 254); + $value = mb_substr($value, 0, 254); $query->setParameter('name', $property->name); $query->setParameter('parameter', null); @@ -2047,7 +2047,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription if ($this->db->supports4ByteText()) { $value = preg_replace('/[\x{10000}-\x{10FFFF}]/u', "\xEF\xBF\xBD", $value); } - $value = substr($value, 0, 254); + $value = mb_substr($value, 0, 254); $query->setParameter('name', $property->name); $query->setParameter('parameter', substr($key, 0, 254));