diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2020-02-25 20:31:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-25 20:31:34 +0100 |
commit | 96011fad852f2e70ce41a47e851e93907af07e51 (patch) | |
tree | 45757344cb9685b775bd7dee9d52e41c621ea1e6 | |
parent | 8816823fb368b688f6c3fe2f703259b3308715ae (diff) | |
parent | bc98a796dee9d6cd94ec0626ce35935228d58255 (diff) | |
download | nextcloud-server-96011fad852f2e70ce41a47e851e93907af07e51.tar.gz nextcloud-server-96011fad852f2e70ce41a47e851e93907af07e51.zip |
Merge pull request #19637 from nextcloud/backport/19634/stable17
[stable17] Correctly trim long cyrillic note
-rw-r--r-- | apps/dav/lib/CalDAV/CalDavBackend.php | 5 | ||||
-rw-r--r-- | apps/dav/lib/CardDAV/CardDavBackend.php | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php index 62d3909ce39..bb2a38fe232 100644 --- a/apps/dav/lib/CalDAV/CalDavBackend.php +++ b/apps/dav/lib/CalDAV/CalDavBackend.php @@ -2463,11 +2463,10 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription if ($this->db->supports4ByteText()) { $value = preg_replace('/[\x{10000}-\x{10FFFF}]/u', "\xEF\xBF\xBD", $value); } - $value = mb_substr($value, 0, 254); $query->setParameter('name', $property->name); - $query->setParameter('parameter', substr($key, 0, 254)); - $query->setParameter('value', substr($value, 0, 254)); + $query->setParameter('parameter', mb_substr($key, 0, 254)); + $query->setParameter('value', mb_substr($value, 0, 254)); $query->execute(); } } diff --git a/apps/dav/lib/CardDAV/CardDavBackend.php b/apps/dav/lib/CardDAV/CardDavBackend.php index 7dbd41a69c8..eaedf638cb6 100644 --- a/apps/dav/lib/CardDAV/CardDavBackend.php +++ b/apps/dav/lib/CardDAV/CardDavBackend.php @@ -1061,7 +1061,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { } } $query->setParameter('name', $property->name); - $query->setParameter('value', substr($property->getValue(), 0, 254)); + $query->setParameter('value', mb_substr($property->getValue(), 0, 254)); $query->setParameter('preferred', $preferred); $query->execute(); } |