diff options
author | Thomas Citharel <tcit@tcit.fr> | 2020-01-05 21:32:33 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2020-03-22 14:24:13 +0100 |
commit | 42dde6d623b2401cb6ef756635b9424325ca5bc3 (patch) | |
tree | 11758d60a1505ac96e50044fab26dbdb68b6f279 | |
parent | 01db6d4609036831e2d5559f65086c9a429b855b (diff) | |
download | nextcloud-server-42dde6d623b2401cb6ef756635b9424325ca5bc3.tar.gz nextcloud-server-42dde6d623b2401cb6ef756635b9424325ca5bc3.zip |
Add check that DateTime parameters are of correct type
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
-rw-r--r-- | apps/dav/lib/CalDAV/CalDavBackend.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php index 0c71b4b386a..96459566a5a 100644 --- a/apps/dav/lib/CalDAV/CalDavBackend.php +++ b/apps/dav/lib/CalDAV/CalDavBackend.php @@ -33,6 +33,7 @@ namespace OCA\DAV\CalDAV; +use DateTime; use OCA\DAV\Connector\Sabre\Principal; use OCA\DAV\DAV\Sharing\Backend; use OCA\DAV\DAV\Sharing\IShareable; @@ -1551,12 +1552,12 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription ->from('calendarobjects', 'c'); if (isset($options['timerange'])) { - if (isset($options['timerange']['start'])) { + if (isset($options['timerange']['start']) && $options['timerange']['start'] instanceof DateTime) { $outerQuery->andWhere($outerQuery->expr()->gt('lastoccurence', $outerQuery->createNamedParameter($options['timerange']['start']->getTimeStamp()))); } - if (isset($options['timerange']['end'])) { + if (isset($options['timerange']['end']) && $options['timerange']['end'] instanceof DateTime) { $outerQuery->andWhere($outerQuery->expr()->lt('firstoccurence', $outerQuery->createNamedParameter($options['timerange']['end']->getTimeStamp()))); } @@ -2258,7 +2259,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription } } else { $it = new EventIterator($vObject, (string)$component->UID); - $maxDate = new \DateTime(self::MAX_DATE); + $maxDate = new DateTime(self::MAX_DATE); if ($it->isInfinite()) { $lastOccurrence = $maxDate->getTimestamp(); } else { |