|
33 | 33 |
|
34 | 34 | namespace OCA\DAV\CalDAV; |
35 | 35 |
|
| 36 | +use DateTime; |
36 | 37 | use OCA\DAV\DAV\Sharing\IShareable; |
37 | 38 | use OCP\DB\QueryBuilder\IQueryBuilder; |
38 | 39 | use OCA\DAV\Connector\Sabre\Principal; |
@@ -445,7 +446,7 @@ private function getUserDisplayName($uid) { |
445 | 446 |
|
446 | 447 | return $this->userDisplayNames[$uid]; |
447 | 448 | } |
448 | | - |
| 449 | + |
449 | 450 | /** |
450 | 451 | * @return array |
451 | 452 | */ |
@@ -1550,12 +1551,12 @@ public function search(array $calendarInfo, $pattern, array $searchProperties, |
1550 | 1551 | ->from('calendarobjects', 'c'); |
1551 | 1552 |
|
1552 | 1553 | if (isset($options['timerange'])) { |
1553 | | - if (isset($options['timerange']['start'])) { |
| 1554 | + if (isset($options['timerange']['start']) && $options['timerange']['start'] instanceof DateTime) { |
1554 | 1555 | $outerQuery->andWhere($outerQuery->expr()->gt('lastoccurence', |
1555 | 1556 | $outerQuery->createNamedParameter($options['timerange']['start']->getTimeStamp()))); |
1556 | 1557 |
|
1557 | 1558 | } |
1558 | | - if (isset($options['timerange']['end'])) { |
| 1559 | + if (isset($options['timerange']['end']) && $options['timerange']['end'] instanceof DateTime) { |
1559 | 1560 | $outerQuery->andWhere($outerQuery->expr()->lt('firstoccurence', |
1560 | 1561 | $outerQuery->createNamedParameter($options['timerange']['end']->getTimeStamp()))); |
1561 | 1562 | } |
@@ -2257,7 +2258,7 @@ public function getDenormalizedData($calendarData) { |
2257 | 2258 | } |
2258 | 2259 | } else { |
2259 | 2260 | $it = new EventIterator($vObject, (string)$component->UID); |
2260 | | - $maxDate = new \DateTime(self::MAX_DATE); |
| 2261 | + $maxDate = new DateTime(self::MAX_DATE); |
2261 | 2262 | if ($it->isInfinite()) { |
2262 | 2263 | $lastOccurrence = $maxDate->getTimestamp(); |
2263 | 2264 | } else { |
|
0 commit comments