aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/lib/CalDAV/Backend/PDO.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/sabre/dav/lib/CalDAV/Backend/PDO.php')
-rw-r--r--vendor/sabre/dav/lib/CalDAV/Backend/PDO.php23
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';