From 90b38d3983a9d2029083f7a2ee655e9c5752479a Mon Sep 17 00:00:00 2001 From: Josh Date: Tue, 13 Oct 2026 09:32:30 -0400 Subject: [PATCH 1/2] fix(dav): handle 4-byte text consistently in calendar indexes CalDAV indexes selected property values and parameters in the same table. However, updateProperties() used opposite supports4ByteText() checks for those two paths. Looks like #36528 may have inadvertently changed this conditional. Additional historical context in #5004. Also remove the redundant pre-truncation in the ordinary-property path. Signed-off-by: Josh --- apps/dav/lib/CalDAV/CalDavBackend.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php index c7a57cf57286d..96ffe81e4a3de 100644 --- a/apps/dav/lib/CalDAV/CalDavBackend.php +++ b/apps/dav/lib/CalDAV/CalDavBackend.php @@ -3690,7 +3690,6 @@ public function updateProperties($calendarId, $objectUri, $calendarData, $calend if (!$this->db->supports4ByteText()) { $value = preg_replace('/[\x{10000}-\x{10FFFF}]/u', "\xEF\xBF\xBD", $value); } - $value = mb_strcut($value, 0, 254); $query->setParameter('name', $property->name); $query->setParameter('parameter', null); @@ -3705,7 +3704,7 @@ public function updateProperties($calendarId, $objectUri, $calendarData, $calend foreach ($parameters as $key => $value) { if (in_array($key, $indexedParametersForProperty)) { // is this a shitty db? - if ($this->db->supports4ByteText()) { + if (!$this->db->supports4ByteText()) { $value = preg_replace('/[\x{10000}-\x{10FFFF}]/u', "\xEF\xBF\xBD", $value); } From 605d118e040566d0e718e6c9b74956142d111211 Mon Sep 17 00:00:00 2001 From: Josh Date: Tue, 13 Oct 2026 09:39:07 -0400 Subject: [PATCH 2/2] test(dav): cover 4-byte text in indexed calendar parameters Add regression coverage for emoji in indexed ATTENDEE and ORGANIZER CN parameters. Assert that indexed values preserve four-byte characters when supported by the database and replace them when unsupported. Assisted-by: Copilot:gpt-6-luna Signed-off-by: Josh