]> source.dussan.org Git - nextcloud-server.git/commitdiff
Correctly trim long cyrillic note 19637/head
authorJoas Schilling <coding@schilljs.com>
Tue, 25 Feb 2020 08:44:58 +0000 (09:44 +0100)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Tue, 25 Feb 2020 13:51:21 +0000 (13:51 +0000)
Signed-off-by: Joas Schilling <coding@schilljs.com>
apps/dav/lib/CalDAV/CalDavBackend.php
apps/dav/lib/CardDAV/CardDavBackend.php

index 62d3909ce39117a92540e8369437fe92da50d1f5..bb2a38fe232fec98c8cb74d7bd1fa270f6e77d72 100644 (file)
@@ -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();
                                                }
                                        }
index 7dbd41a69c8cf7e143eeb4ef65a4901b94fe3cdc..eaedf638cb61405e39cd08a690a9ef8d3073c513 100644 (file)
@@ -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();
                }