summaryrefslogtreecommitdiffstats
path: root/apps/dav
diff options
context:
space:
mode:
authorChristoph Wurst <ChristophWurst@users.noreply.github.com>2021-10-28 22:15:13 +0200
committerGitHub <noreply@github.com>2021-10-28 22:15:13 +0200
commit2d698cc6293e340586a04003961e2a377bd0feb5 (patch)
tree3a7b7c33e36d4a519326a3fe431fd8ae1ed26430 /apps/dav
parentb6a4e024a437e1381ed251c0bd7e375a2cf9a428 (diff)
parent2956f1c017e77f68b4705a3bedbe8fba0a61e0ae (diff)
downloadnextcloud-server-2d698cc6293e340586a04003961e2a377bd0feb5.tar.gz
nextcloud-server-2d698cc6293e340586a04003961e2a377bd0feb5.zip
Merge pull request #29481 from nextcloud/fix/dav-calendar-query-start-end-immutable
Fix immutable datetime handling in DAV calendar search
Diffstat (limited to 'apps/dav')
-rw-r--r--apps/dav/lib/CalDAV/CalDavBackend.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php
index 64ee76f94d1..7094358a2c6 100644
--- a/apps/dav/lib/CalDAV/CalDavBackend.php
+++ b/apps/dav/lib/CalDAV/CalDavBackend.php
@@ -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())));
}