diff options
author | Mario <mario@mariovavti.com> | 2021-03-08 09:31:23 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2021-03-08 09:31:23 +0000 |
commit | 951e9c8c4f39dd8577834d5bc501c05d80722de9 (patch) | |
tree | 6a42c6a229c7b2b3e13bc5af77a733d054242695 /vendor/sabre/dav/lib/CalDAV/Backend/PDO.php | |
parent | f94b046333c57acde493ee5dc2511acc6baca701 (diff) | |
parent | 89415e17313578eb115c441480b6e0ddfa90afef (diff) | |
download | volse-hubzilla-5.4.tar.gz volse-hubzilla-5.4.tar.bz2 volse-hubzilla-5.4.zip |
Merge branch '5.4RC'5.4
Diffstat (limited to 'vendor/sabre/dav/lib/CalDAV/Backend/PDO.php')
-rw-r--r-- | vendor/sabre/dav/lib/CalDAV/Backend/PDO.php | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/vendor/sabre/dav/lib/CalDAV/Backend/PDO.php b/vendor/sabre/dav/lib/CalDAV/Backend/PDO.php index 7a07724b3..0d5df3968 100644 --- a/vendor/sabre/dav/lib/CalDAV/Backend/PDO.php +++ b/vendor/sabre/dav/lib/CalDAV/Backend/PDO.php @@ -7,6 +7,7 @@ namespace Sabre\CalDAV\Backend; use Sabre\CalDAV; use Sabre\DAV; use Sabre\DAV\Exception\Forbidden; +use Sabre\DAV\PropPatch; use Sabre\DAV\Xml\Element\Sharee; use Sabre\VObject; @@ -289,7 +290,7 @@ SQL * * @param mixed $calendarId */ - public function updateCalendar($calendarId, \Sabre\DAV\PropPatch $propPatch) + public function updateCalendar($calendarId, PropPatch $propPatch) { if (!is_array($calendarId)) { throw new \InvalidArgumentException('The value passed to $calendarId is expected to be an array with a calendarId and an instanceId'); @@ -779,17 +780,20 @@ SQL $componentType = $filters['comp-filters'][0]['name']; // Checking if we need post-filters - if (!$filters['prop-filters'] && !$filters['comp-filters'][0]['comp-filters'] && !$filters['comp-filters'][0]['time-range'] && !$filters['comp-filters'][0]['prop-filters']) { + $has_time_range = array_key_exists('time-range', $filters['comp-filters'][0]) && $filters['comp-filters'][0]['time-range']; + if (!$filters['prop-filters'] && !$filters['comp-filters'][0]['comp-filters'] && !$has_time_range && !$filters['comp-filters'][0]['prop-filters']) { $requirePostFilter = false; } // There was a time-range filter - if ('VEVENT' == $componentType && isset($filters['comp-filters'][0]['time-range'])) { + if ('VEVENT' == $componentType && $has_time_range) { $timeRange = $filters['comp-filters'][0]['time-range']; // If start time OR the end time is not specified, we can do a // 100% accurate mysql query. - if (!$filters['prop-filters'] && !$filters['comp-filters'][0]['comp-filters'] && !$filters['comp-filters'][0]['prop-filters'] && (!$timeRange['start'] || !$timeRange['end'])) { - $requirePostFilter = false; + if (!$filters['prop-filters'] && !$filters['comp-filters'][0]['comp-filters'] && !$filters['comp-filters'][0]['prop-filters'] && $timeRange) { + if ((array_key_exists('start', $timeRange) && !$timeRange['start']) || (array_key_exists('end', $timeRange) && !$timeRange['end'])) { + $requirePostFilter = false; + } } } } @@ -809,11 +813,11 @@ SQL $values['componenttype'] = $componentType; } - if ($timeRange && $timeRange['start']) { + if ($timeRange && array_key_exists('start', $timeRange) && $timeRange['start']) { $query .= ' AND lastoccurence > :startdate'; $values['startdate'] = $timeRange['start']->getTimeStamp(); } - if ($timeRange && $timeRange['end']) { + if ($timeRange && array_key_exists('end', $timeRange) && $timeRange['end']) { $query .= ' AND firstoccurence < :enddate'; $values['enddate'] = $timeRange['end']->getTimeStamp(); } @@ -1153,10 +1157,9 @@ SQL; * * Read the PropPatch documentation for more info and examples. * - * @param mixed $subscriptionId - * @param \Sabre\DAV\PropPatch $propPatch + * @param mixed $subscriptionId */ - public function updateSubscription($subscriptionId, DAV\PropPatch $propPatch) + public function updateSubscription($subscriptionId, PropPatch $propPatch) { $supportedProperties = array_keys($this->subscriptionPropertyMap); $supportedProperties[] = '{http://calendarserver.org/ns/}source'; |