diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php index abeaab14a44c..52fb40013acf 100644 --- a/apps/dav/lib/CalDAV/CalDavBackend.php +++ b/apps/dav/lib/CalDAV/CalDavBackend.php @@ -1480,7 +1480,7 @@ function createSchedulingObject($principalUri, $objectUri, $objectData) { $query->insert('schedulingobjects') ->values([ 'principaluri' => $query->createNamedParameter($principalUri), - 'calendardata' => $query->createNamedParameter($objectData), + 'calendardata' => $query->createNamedParameter($objectData, IQueryBuilder::PARAM_LOB), 'uri' => $query->createNamedParameter($objectUri), 'lastmodified' => $query->createNamedParameter(time()), 'etag' => $query->createNamedParameter(md5($objectData)), diff --git a/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php b/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php index a8de6f09f46e..cddd83ffc737 100644 --- a/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php +++ b/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php @@ -495,8 +495,84 @@ public function testSubscriptions() { $this->assertCount(0, $subscriptions); } - public function testScheduling() { - $this->backend->createSchedulingObject(self::UNIT_TEST_USER, 'Sample Schedule', ''); + public function providesSchedulingData() { + $data =<<'\;'~\n o_)\; \; )))(((` ~--- + ~ `:: \\ %%~~)(v\;(`('~\n \; ''''```` + `: `:::|\\\,__\,%% )\;`'\; ~\n | _ + ) / `:|`----' `-'\n ______/\\/~ | + / /\n /~\;\;.____/\;\;' / ___--\ + ,-( `\;\;\;/\n / // _\;______\;'------~~~~~ /\;\;/\\ /\n + // | | / \; \\\;\;\,\\\n (<_ | \; + /'\,/-----' _>\n \\_| ||_ + //~\;~~~~~~~~~\n `\\_| (\,~~ -Tua Xiong\n + \\~\\\n + ~~\n\n +SEQUENCE:1 +X-MOZ-GENERATION:1 +END:VEVENT +END:VCALENDAR +EOS; + + return [ + 'no data' => [''], + 'failing on postgres' => [$data] + ]; + } + + /** + * @dataProvider providesSchedulingData + * @param $objectData + */ + public function testScheduling($objectData) { + $this->backend->createSchedulingObject(self::UNIT_TEST_USER, 'Sample Schedule', $objectData); $sos = $this->backend->getSchedulingObjects(self::UNIT_TEST_USER); $this->assertCount(1, $sos);