Merge pull request #9234 from nextcloud/13-7661

[stable13] Use multibyte substring
This commit is contained in:
Julius Härtl 2018-04-18 19:15:50 +02:00 committed by GitHub
commit 89c77c3073
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -2253,7 +2253,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);
@ -2271,7 +2271,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));