]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix immutable datetime handling in DAV calendar search 29481/head
authorChristoph Wurst <christoph@winzerhof-wurst.at>
Thu, 28 Oct 2021 16:37:20 +0000 (18:37 +0200)
committerChristoph Wurst <christoph@winzerhof-wurst.at>
Thu, 28 Oct 2021 17:45:39 +0000 (19:45 +0200)
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
apps/dav/lib/CalDAV/CalDavBackend.php

index 64ee76f94d166756074821e6c556849c74630ae7..7094358a2c6f9d819cdd4091fa09b30fd6340539 100644 (file)
@@ -39,6 +39,7 @@
 namespace OCA\DAV\CalDAV;
 
 use DateTime;
+use DateTimeInterface;
 use OCA\DAV\AppInfo\Application;
 use OCA\DAV\Connector\Sabre\Principal;
 use OCA\DAV\DAV\Sharing\Backend;
@@ -1870,11 +1871,11 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
                        ->where($outerQuery->expr()->isNull('deleted_at'));
 
                if (isset($options['timerange'])) {
-                       if (isset($options['timerange']['start']) && $options['timerange']['start'] instanceof DateTime) {
+                       if (isset($options['timerange']['start']) && $options['timerange']['start'] instanceof DateTimeInterface) {
                                $outerQuery->andWhere($outerQuery->expr()->gt('lastoccurence',
                                        $outerQuery->createNamedParameter($options['timerange']['start']->getTimeStamp())));
                        }
-                       if (isset($options['timerange']['end']) && $options['timerange']['end'] instanceof DateTime) {
+                       if (isset($options['timerange']['end']) && $options['timerange']['end'] instanceof DateTimeInterface) {
                                $outerQuery->andWhere($outerQuery->expr()->lt('firstoccurence',
                                        $outerQuery->createNamedParameter($options['timerange']['end']->getTimeStamp())));
                        }