mirror of
https://github.com/nextcloud/server.git
synced 2026-05-25 02:34:12 -04:00
Add check that DateTime parameters are of correct type
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
95761684f6
commit
9a0cf46ad0
1 changed files with 5 additions and 4 deletions
|
|
@ -33,6 +33,7 @@
|
|||
|
||||
namespace OCA\DAV\CalDAV;
|
||||
|
||||
use DateTime;
|
||||
use OCA\DAV\DAV\Sharing\IShareable;
|
||||
use OCP\DB\QueryBuilder\IQueryBuilder;
|
||||
use OCA\DAV\Connector\Sabre\Principal;
|
||||
|
|
@ -445,7 +446,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
|
|||
|
||||
return $this->userDisplayNames[$uid];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
|
|
@ -1549,12 +1550,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())));
|
||||
}
|
||||
|
|
@ -2256,7 +2257,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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue