diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php index b6502a2616..8a3db1cd13 100644 --- a/apps/dav/lib/CalDAV/CalDavBackend.php +++ b/apps/dav/lib/CalDAV/CalDavBackend.php @@ -1985,7 +1985,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription $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 0b8978a040..cd46bf553b 100644 --- a/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php +++ b/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php @@ -561,8 +561,84 @@ EOD; $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);