aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/lib
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/sabre/dav/lib')
-rw-r--r--vendor/sabre/dav/lib/CalDAV/Backend/PDO.php23
-rw-r--r--vendor/sabre/dav/lib/CalDAV/CalendarQueryValidator.php26
-rw-r--r--vendor/sabre/dav/lib/CalDAV/Schedule/Plugin.php1
-rw-r--r--vendor/sabre/dav/lib/CalDAV/SharingPlugin.php4
-rw-r--r--vendor/sabre/dav/lib/CalDAV/Xml/Filter/CalendarData.php1
-rw-r--r--vendor/sabre/dav/lib/CardDAV/Backend/PDO.php3
-rw-r--r--vendor/sabre/dav/lib/CardDAV/Plugin.php21
-rw-r--r--vendor/sabre/dav/lib/CardDAV/Xml/Request/AddressBookQueryReport.php1
-rw-r--r--vendor/sabre/dav/lib/DAV/Browser/Plugin.php4
-rw-r--r--vendor/sabre/dav/lib/DAV/Exception/MethodNotAllowed.php3
-rw-r--r--vendor/sabre/dav/lib/DAV/FSExt/File.php5
-rw-r--r--vendor/sabre/dav/lib/DAV/Server.php2
-rw-r--r--vendor/sabre/dav/lib/DAV/Sharing/Plugin.php1
-rw-r--r--vendor/sabre/dav/lib/DAV/Tree.php2
-rw-r--r--vendor/sabre/dav/lib/DAV/Version.php2
-rw-r--r--vendor/sabre/dav/lib/DAV/Xml/Property/GetLastModified.php3
-rw-r--r--vendor/sabre/dav/lib/DAV/Xml/Property/Href.php3
-rw-r--r--vendor/sabre/dav/lib/DAV/Xml/Property/ResourceType.php3
18 files changed, 65 insertions, 43 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';
diff --git a/vendor/sabre/dav/lib/CalDAV/CalendarQueryValidator.php b/vendor/sabre/dav/lib/CalDAV/CalendarQueryValidator.php
index 7ce1c05b7..ee525da7a 100644
--- a/vendor/sabre/dav/lib/CalDAV/CalendarQueryValidator.php
+++ b/vendor/sabre/dav/lib/CalDAV/CalendarQueryValidator.php
@@ -67,9 +67,17 @@ class CalendarQueryValidator
return false;
}
- if ($filter['time-range']) {
+ if (array_key_exists('time-range', $filter) && $filter['time-range']) {
foreach ($parent->{$filter['name']} as $subComponent) {
- if ($this->validateTimeRange($subComponent, $filter['time-range']['start'], $filter['time-range']['end'])) {
+ $start = null;
+ $end = null;
+ if (array_key_exists('start', $filter['time-range'])) {
+ $start = $filter['time-range']['start'];
+ }
+ if (array_key_exists('end', $filter['time-range'])) {
+ $end = $filter['time-range']['end'];
+ }
+ if ($this->validateTimeRange($subComponent, $start, $end)) {
continue 2;
}
}
@@ -128,9 +136,17 @@ class CalendarQueryValidator
return false;
}
- if ($filter['time-range']) {
+ if (array_key_exists('time-range', $filter) && $filter['time-range']) {
foreach ($parent->{$filter['name']} as $subComponent) {
- if ($this->validateTimeRange($subComponent, $filter['time-range']['start'], $filter['time-range']['end'])) {
+ $start = null;
+ $end = null;
+ if (array_key_exists('start', $filter['time-range'])) {
+ $start = $filter['time-range']['start'];
+ }
+ if (array_key_exists('end', $filter['time-range'])) {
+ $end = $filter['time-range']['end'];
+ }
+ if ($this->validateTimeRange($subComponent, $start, $end)) {
continue 2;
}
}
@@ -258,11 +274,9 @@ class CalendarQueryValidator
case 'VEVENT':
case 'VTODO':
case 'VJOURNAL':
-
return $component->isInTimeRange($start, $end);
case 'VALARM':
-
// If the valarm is wrapped in a recurring event, we need to
// expand the recursions, and validate each.
//
diff --git a/vendor/sabre/dav/lib/CalDAV/Schedule/Plugin.php b/vendor/sabre/dav/lib/CalDAV/Schedule/Plugin.php
index a1f8202ec..38a7ca96f 100644
--- a/vendor/sabre/dav/lib/CalDAV/Schedule/Plugin.php
+++ b/vendor/sabre/dav/lib/CalDAV/Schedule/Plugin.php
@@ -486,6 +486,7 @@ class Plugin extends ServerPlugin
$currentObject = null;
$objectNode = null;
+ $oldICalendarData = null;
$isNewNode = false;
$result = $home->getCalendarObjectByUID($uid);
diff --git a/vendor/sabre/dav/lib/CalDAV/SharingPlugin.php b/vendor/sabre/dav/lib/CalDAV/SharingPlugin.php
index 090cc34bf..f7dca9be6 100644
--- a/vendor/sabre/dav/lib/CalDAV/SharingPlugin.php
+++ b/vendor/sabre/dav/lib/CalDAV/SharingPlugin.php
@@ -213,7 +213,6 @@ class SharingPlugin extends DAV\ServerPlugin
// Both the DAV:share-resource and CALENDARSERVER:share requests
// behave identically.
case '{'.Plugin::NS_CALENDARSERVER.'}share':
-
$sharingPlugin = $this->server->getPlugin('sharing');
$sharingPlugin->shareResource($path, $message->sharees);
@@ -228,7 +227,6 @@ class SharingPlugin extends DAV\ServerPlugin
// The invite-reply document is sent when the user replies to an
// invitation of a calendar share.
case '{'.Plugin::NS_CALENDARSERVER.'}invite-reply':
-
// This only works on the calendar-home-root node.
if (!$node instanceof CalendarHome) {
return;
@@ -272,7 +270,6 @@ class SharingPlugin extends DAV\ServerPlugin
return false;
case '{'.Plugin::NS_CALENDARSERVER.'}publish-calendar':
-
// We can only deal with IShareableCalendar objects
if (!$node instanceof ISharedCalendar) {
return;
@@ -300,7 +297,6 @@ class SharingPlugin extends DAV\ServerPlugin
return false;
case '{'.Plugin::NS_CALENDARSERVER.'}unpublish-calendar':
-
// We can only deal with IShareableCalendar objects
if (!$node instanceof ISharedCalendar) {
return;
diff --git a/vendor/sabre/dav/lib/CalDAV/Xml/Filter/CalendarData.php b/vendor/sabre/dav/lib/CalDAV/Xml/Filter/CalendarData.php
index baa4250ab..c9656d8a3 100644
--- a/vendor/sabre/dav/lib/CalDAV/Xml/Filter/CalendarData.php
+++ b/vendor/sabre/dav/lib/CalDAV/Xml/Filter/CalendarData.php
@@ -60,7 +60,6 @@ class CalendarData implements XmlDeserializable
foreach ($elems as $elem) {
switch ($elem['name']) {
case '{'.Plugin::NS_CALDAV.'}expand':
-
$result['expand'] = [
'start' => isset($elem['attributes']['start']) ? DateTimeParser::parseDateTime($elem['attributes']['start']) : null,
'end' => isset($elem['attributes']['end']) ? DateTimeParser::parseDateTime($elem['attributes']['end']) : null,
diff --git a/vendor/sabre/dav/lib/CardDAV/Backend/PDO.php b/vendor/sabre/dav/lib/CardDAV/Backend/PDO.php
index a33de48de..966d7ba09 100644
--- a/vendor/sabre/dav/lib/CardDAV/Backend/PDO.php
+++ b/vendor/sabre/dav/lib/CardDAV/Backend/PDO.php
@@ -6,6 +6,7 @@ namespace Sabre\CardDAV\Backend;
use Sabre\CardDAV;
use Sabre\DAV;
+use Sabre\DAV\PropPatch;
/**
* PDO CardDAV backend.
@@ -93,7 +94,7 @@ class PDO extends AbstractBackend implements SyncSupport
*
* @param string $addressBookId
*/
- public function updateAddressBook($addressBookId, \Sabre\DAV\PropPatch $propPatch)
+ public function updateAddressBook($addressBookId, PropPatch $propPatch)
{
$supportedProperties = [
'{DAV:}displayname',
diff --git a/vendor/sabre/dav/lib/CardDAV/Plugin.php b/vendor/sabre/dav/lib/CardDAV/Plugin.php
index 09d1f593d..c2d31d9df 100644
--- a/vendor/sabre/dav/lib/CardDAV/Plugin.php
+++ b/vendor/sabre/dav/lib/CardDAV/Plugin.php
@@ -587,14 +587,21 @@ class Plugin extends DAV\ServerPlugin
foreach ($vProperties as $vProperty) {
// If we got all the way here, we'll need to validate the
// text-match filter.
- $success = DAV\StringUtil::textMatch($vProperty[$filter['name']]->getValue(), $filter['text-match']['value'], $filter['text-match']['collation'], $filter['text-match']['match-type']);
+ if (isset($vProperty[$filter['name']])) {
+ $success = DAV\StringUtil::textMatch(
+ $vProperty[$filter['name']]->getValue(),
+ $filter['text-match']['value'],
+ $filter['text-match']['collation'],
+ $filter['text-match']['match-type']
+ );
+ if ($filter['text-match']['negate-condition']) {
+ $success = !$success;
+ }
+ }
if ($success) {
break;
}
}
- if ($filter['text-match']['negate-condition']) {
- $success = !$success;
- }
} // else
// There are two conditions where we can already determine whether
@@ -628,15 +635,15 @@ class Plugin extends DAV\ServerPlugin
$success = false;
foreach ($texts as $haystack) {
$success = DAV\StringUtil::textMatch($haystack, $filter['value'], $filter['collation'], $filter['match-type']);
+ if ($filter['negate-condition']) {
+ $success = !$success;
+ }
// Breaking on the first match
if ($success) {
break;
}
}
- if ($filter['negate-condition']) {
- $success = !$success;
- }
if ($success && 'anyof' === $test) {
return true;
diff --git a/vendor/sabre/dav/lib/CardDAV/Xml/Request/AddressBookQueryReport.php b/vendor/sabre/dav/lib/CardDAV/Xml/Request/AddressBookQueryReport.php
index d3651ae61..e1096fe28 100644
--- a/vendor/sabre/dav/lib/CardDAV/Xml/Request/AddressBookQueryReport.php
+++ b/vendor/sabre/dav/lib/CardDAV/Xml/Request/AddressBookQueryReport.php
@@ -146,7 +146,6 @@ class AddressBookQueryReport implements XmlDeserializable
}
break;
case '{'.Plugin::NS_CARDDAV.'}filter':
-
if (!is_null($newProps['filters'])) {
throw new BadRequest('You can only include 1 {'.Plugin::NS_CARDDAV.'}filter element');
}
diff --git a/vendor/sabre/dav/lib/DAV/Browser/Plugin.php b/vendor/sabre/dav/lib/DAV/Browser/Plugin.php
index 915f2895b..2f155d9ea 100644
--- a/vendor/sabre/dav/lib/DAV/Browser/Plugin.php
+++ b/vendor/sabre/dav/lib/DAV/Browser/Plugin.php
@@ -157,6 +157,9 @@ class Plugin extends DAV\ServerPlugin
public function httpPOST(RequestInterface $request, ResponseInterface $response)
{
$contentType = $request->getHeader('Content-Type');
+ if (!\is_string($contentType)) {
+ return;
+ }
list($contentType) = explode(';', $contentType);
if ('application/x-www-form-urlencoded' !== $contentType &&
'multipart/form-data' !== $contentType) {
@@ -209,7 +212,6 @@ class Plugin extends DAV\ServerPlugin
// @codeCoverageIgnoreStart
case 'put':
-
if ($_FILES) {
$file = current($_FILES);
} else {
diff --git a/vendor/sabre/dav/lib/DAV/Exception/MethodNotAllowed.php b/vendor/sabre/dav/lib/DAV/Exception/MethodNotAllowed.php
index d1ac349bd..dbf42ed9f 100644
--- a/vendor/sabre/dav/lib/DAV/Exception/MethodNotAllowed.php
+++ b/vendor/sabre/dav/lib/DAV/Exception/MethodNotAllowed.php
@@ -5,6 +5,7 @@ declare(strict_types=1);
namespace Sabre\DAV\Exception;
use Sabre\DAV;
+use Sabre\DAV\Server;
/**
* MethodNotAllowed.
@@ -34,7 +35,7 @@ class MethodNotAllowed extends DAV\Exception
*
* @return array
*/
- public function getHTTPHeaders(\Sabre\DAV\Server $server)
+ public function getHTTPHeaders(Server $server)
{
$methods = $server->getAllowedMethods($server->getRequestUri());
diff --git a/vendor/sabre/dav/lib/DAV/FSExt/File.php b/vendor/sabre/dav/lib/DAV/FSExt/File.php
index 060ef5a48..74849b564 100644
--- a/vendor/sabre/dav/lib/DAV/FSExt/File.php
+++ b/vendor/sabre/dav/lib/DAV/FSExt/File.php
@@ -41,7 +41,7 @@ class File extends Node implements DAV\PartialUpdate\IPatchSupport
*
* The second argument is the type of update we're doing.
* This is either:
- * * 1. append
+ * * 1. append (default)
* * 2. update based on a start byte
* * 3. update based on an end byte
*;
@@ -75,6 +75,9 @@ class File extends Node implements DAV\PartialUpdate\IPatchSupport
$f = fopen($this->path, 'c');
fseek($f, $offset, SEEK_END);
break;
+ default:
+ $f = fopen($this->path, 'a');
+ break;
}
if (is_string($data)) {
fwrite($f, $data);
diff --git a/vendor/sabre/dav/lib/DAV/Server.php b/vendor/sabre/dav/lib/DAV/Server.php
index 4c213c1bd..de663d0c1 100644
--- a/vendor/sabre/dav/lib/DAV/Server.php
+++ b/vendor/sabre/dav/lib/DAV/Server.php
@@ -25,8 +25,8 @@ use Sabre\Xml\Writer;
*/
class Server implements LoggerAwareInterface, EmitterInterface
{
- use WildcardEmitterTrait;
use LoggerAwareTrait;
+ use WildcardEmitterTrait;
/**
* Infinity is used for some request supporting the HTTP Depth header and indicates that the operation should traverse the entire tree.
diff --git a/vendor/sabre/dav/lib/DAV/Sharing/Plugin.php b/vendor/sabre/dav/lib/DAV/Sharing/Plugin.php
index 3a41e67b4..e7adbeee6 100644
--- a/vendor/sabre/dav/lib/DAV/Sharing/Plugin.php
+++ b/vendor/sabre/dav/lib/DAV/Sharing/Plugin.php
@@ -179,7 +179,6 @@ class Plugin extends ServerPlugin
switch ($documentType) {
case '{DAV:}share-resource':
-
$this->shareResource($path, $message->sharees);
$response->setStatus(200);
// Adding this because sending a response body may cause issues,
diff --git a/vendor/sabre/dav/lib/DAV/Tree.php b/vendor/sabre/dav/lib/DAV/Tree.php
index aedc0155d..2417979a6 100644
--- a/vendor/sabre/dav/lib/DAV/Tree.php
+++ b/vendor/sabre/dav/lib/DAV/Tree.php
@@ -292,6 +292,8 @@ class Tree
$destinationName = $source->getName();
}
+ $destination = null;
+
if ($source instanceof IFile) {
$data = $source->get();
diff --git a/vendor/sabre/dav/lib/DAV/Version.php b/vendor/sabre/dav/lib/DAV/Version.php
index 70948305e..b25d6c07a 100644
--- a/vendor/sabre/dav/lib/DAV/Version.php
+++ b/vendor/sabre/dav/lib/DAV/Version.php
@@ -16,5 +16,5 @@ class Version
/**
* Full version number.
*/
- public const VERSION = '4.1.3';
+ public const VERSION = '4.1.5';
}
diff --git a/vendor/sabre/dav/lib/DAV/Xml/Property/GetLastModified.php b/vendor/sabre/dav/lib/DAV/Xml/Property/GetLastModified.php
index c6f6d421c..efc15c293 100644
--- a/vendor/sabre/dav/lib/DAV/Xml/Property/GetLastModified.php
+++ b/vendor/sabre/dav/lib/DAV/Xml/Property/GetLastModified.php
@@ -98,7 +98,6 @@ class GetLastModified implements Element
*/
public static function xmlDeserialize(Reader $reader)
{
- return
- new self(new DateTime($reader->parseInnerTree()));
+ return new self(new DateTime($reader->parseInnerTree()));
}
}
diff --git a/vendor/sabre/dav/lib/DAV/Xml/Property/Href.php b/vendor/sabre/dav/lib/DAV/Xml/Property/Href.php
index 0ed14dcf3..f88ce814a 100644
--- a/vendor/sabre/dav/lib/DAV/Xml/Property/Href.php
+++ b/vendor/sabre/dav/lib/DAV/Xml/Property/Href.php
@@ -39,9 +39,6 @@ class Href implements Element, HtmlOutput
*
* You must either pass a string for a single href, or an array of hrefs.
*
- * If auto-prefix is set to false, the hrefs will be treated as absolute
- * and not relative to the servers base uri.
- *
* @param string|string[] $hrefs
*/
public function __construct($hrefs)
diff --git a/vendor/sabre/dav/lib/DAV/Xml/Property/ResourceType.php b/vendor/sabre/dav/lib/DAV/Xml/Property/ResourceType.php
index 6532b70c9..75ddcba3f 100644
--- a/vendor/sabre/dav/lib/DAV/Xml/Property/ResourceType.php
+++ b/vendor/sabre/dav/lib/DAV/Xml/Property/ResourceType.php
@@ -94,8 +94,7 @@ class ResourceType extends Element\Elements implements HtmlOutput
*/
public static function xmlDeserialize(Reader $reader)
{
- return
- new self(parent::xmlDeserialize($reader));
+ return new self(parent::xmlDeserialize($reader));
}
/**