Use multibyte substring

Fixes #7661

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2018-04-05 22:26:38 +02:00
parent feef3cbba0
commit 0864d1c51d
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 2 additions and 2 deletions

View File

@ -2251,7 +2251,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);
@ -2269,7 +2269,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));