From b3bf1e0a16ecf3573300ee0d8d57e7f00e6ece9e Mon Sep 17 00:00:00 2001 From: Louis Chemineau Date: Wed, 15 Nov 2023 22:26:29 +0100 Subject: [PATCH] Bump icewind/searchdav to 3.1.0 in master Signed-off-by: Louis Chemineau --- composer.json | 2 +- composer.lock | 39 ++++++++-------- composer/autoload_classmap.php | 1 + composer/autoload_psr4.php | 5 +- composer/autoload_static.php | 22 ++------- composer/installed.json | 41 ++++++++--------- composer/installed.php | 16 +++---- icewind/searchdav/src/DAV/QueryParser.php | 1 + .../lib/CalDAV/Backend/AbstractBackend.php | 4 +- sabre/dav/lib/CalDAV/Backend/PDO.php | 2 +- sabre/dav/lib/CalDAV/Backend/SyncSupport.php | 2 +- sabre/dav/lib/CalDAV/Calendar.php | 12 ++--- sabre/dav/lib/CalDAV/CalendarHome.php | 4 +- sabre/dav/lib/CalDAV/Schedule/IMipPlugin.php | 7 --- sabre/dav/lib/CalDAV/Schedule/Plugin.php | 9 ++-- .../dav/lib/CalDAV/Xml/Filter/PropFilter.php | 2 +- sabre/dav/lib/CardDAV/AddressBook.php | 14 +++--- sabre/dav/lib/CardDAV/AddressBookHome.php | 4 +- sabre/dav/lib/CardDAV/Backend/PDO.php | 2 +- sabre/dav/lib/CardDAV/Backend/SyncSupport.php | 2 +- .../Xml/Request/AddressBookMultiGetReport.php | 9 +++- sabre/dav/lib/DAV/INodeByPath.php | 36 +++++++++++++++ sabre/dav/lib/DAV/Sync/ISyncCollection.php | 2 +- sabre/dav/lib/DAV/Tree.php | 30 +++++++----- sabre/dav/lib/DAV/Version.php | 2 +- sabre/dav/lib/DAV/Xml/Element/Response.php | 46 ++++++++++++------- .../PrincipalBackend/BackendInterface.php | 2 +- 27 files changed, 176 insertions(+), 142 deletions(-) create mode 100644 sabre/dav/lib/DAV/INodeByPath.php diff --git a/composer.json b/composer.json index ea7c0bec3..70637b169 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "fusonic/opengraph": "^2.2", "giggsey/libphonenumber-for-php-lite": "^8.13.12", "guzzlehttp/guzzle": "^7.5.0", - "icewind/searchdav": "^3.0", + "icewind/searchdav": "^3.1.0", "icewind/streams": "^0.7.7", "laravel/serializable-closure": "^1.2.2", "mexitek/phpcolors": "^1.0", diff --git a/composer.lock b/composer.lock index 4b1e1cea6..fcaa87de2 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0f5b8d692567d75d6111be74e10dfed1", + "content-hash": "0a5a90741c696278519e98713c9e1dcf", "packages": [ { "name": "aws/aws-crt-php", @@ -1618,16 +1618,16 @@ }, { "name": "icewind/searchdav", - "version": "v3.0.1", + "version": "v3.1.0", "source": { "type": "git", "url": "https://github.com/icewind1991/SearchDAV.git", - "reference": "52c8cfc21bd69271f224671c4924d260b0a8d4fb" + "reference": "8339181df313361da4daee6cb1c7f144f67f8492" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/icewind1991/SearchDAV/zipball/52c8cfc21bd69271f224671c4924d260b0a8d4fb", - "reference": "52c8cfc21bd69271f224671c4924d260b0a8d4fb", + "url": "https://api.github.com/repos/icewind1991/SearchDAV/zipball/8339181df313361da4daee6cb1c7f144f67f8492", + "reference": "8339181df313361da4daee6cb1c7f144f67f8492", "shasum": "" }, "require": { @@ -1660,9 +1660,9 @@ "description": "sabre/dav plugin to implement rfc5323 SEARCH", "support": { "issues": "https://github.com/icewind1991/SearchDAV/issues", - "source": "https://github.com/icewind1991/SearchDAV/tree/v3.0.1" + "source": "https://github.com/icewind1991/SearchDAV/tree/v3.1.0" }, - "time": "2022-04-11T13:02:49+00:00" + "time": "2023-11-14T22:32:04+00:00" }, { "name": "icewind/streams", @@ -3700,16 +3700,16 @@ }, { "name": "sabre/dav", - "version": "4.4.0", + "version": "4.5.0", "source": { "type": "git", "url": "https://github.com/sabre-io/dav.git", - "reference": "b65362abc926520eda2c57e219f022a6c288069d" + "reference": "7e40343e473f17eab3d1d6ca4ae3e1cdfc6e0fd8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sabre-io/dav/zipball/b65362abc926520eda2c57e219f022a6c288069d", - "reference": "b65362abc926520eda2c57e219f022a6c288069d", + "url": "https://api.github.com/repos/sabre-io/dav/zipball/7e40343e473f17eab3d1d6ca4ae3e1cdfc6e0fd8", + "reference": "7e40343e473f17eab3d1d6ca4ae3e1cdfc6e0fd8", "shasum": "" }, "require": { @@ -3732,11 +3732,11 @@ "sabre/xml": "^2.0.1" }, "require-dev": { - "evert/phpdoc-md": "~0.1.0", - "friendsofphp/php-cs-fixer": "^2.17.1", - "monolog/monolog": "^1.18", - "phpstan/phpstan": "^0.12", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.0" + "friendsofphp/php-cs-fixer": "^2.19", + "monolog/monolog": "^1.27", + "phpstan/phpstan": "^0.12 || ^1.0", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6" }, "suggest": { "ext-curl": "*", @@ -3750,10 +3750,7 @@ "type": "library", "autoload": { "psr-4": { - "Sabre\\DAV\\": "lib/DAV/", - "Sabre\\CalDAV\\": "lib/CalDAV/", - "Sabre\\DAVACL\\": "lib/DAVACL/", - "Sabre\\CardDAV\\": "lib/CardDAV/" + "Sabre\\": "lib/" } }, "notification-url": "https://packagist.org/downloads/", @@ -3782,7 +3779,7 @@ "issues": "https://github.com/sabre-io/dav/issues", "source": "https://github.com/fruux/sabre-dav" }, - "time": "2022-06-27T09:07:55+00:00" + "time": "2023-11-14T10:48:05+00:00" }, { "name": "sabre/event", diff --git a/composer/autoload_classmap.php b/composer/autoload_classmap.php index 9dd93b22e..2ce38cf80 100644 --- a/composer/autoload_classmap.php +++ b/composer/autoload_classmap.php @@ -2414,6 +2414,7 @@ 'Sabre\\DAV\\IMoveTarget' => $vendorDir . '/sabre/dav/lib/DAV/IMoveTarget.php', 'Sabre\\DAV\\IMultiGet' => $vendorDir . '/sabre/dav/lib/DAV/IMultiGet.php', 'Sabre\\DAV\\INode' => $vendorDir . '/sabre/dav/lib/DAV/INode.php', + 'Sabre\\DAV\\INodeByPath' => $vendorDir . '/sabre/dav/lib/DAV/INodeByPath.php', 'Sabre\\DAV\\IProperties' => $vendorDir . '/sabre/dav/lib/DAV/IProperties.php', 'Sabre\\DAV\\IQuota' => $vendorDir . '/sabre/dav/lib/DAV/IQuota.php', 'Sabre\\DAV\\Locks\\Backend\\AbstractBackend' => $vendorDir . '/sabre/dav/lib/DAV/Locks/Backend/AbstractBackend.php', diff --git a/composer/autoload_psr4.php b/composer/autoload_psr4.php index 524490acd..0e269438f 100644 --- a/composer/autoload_psr4.php +++ b/composer/autoload_psr4.php @@ -46,10 +46,7 @@ 'Sabre\\Uri\\' => array($vendorDir . '/sabre/uri/lib'), 'Sabre\\HTTP\\' => array($vendorDir . '/sabre/http/lib'), 'Sabre\\Event\\' => array($vendorDir . '/sabre/event/lib'), - 'Sabre\\DAV\\' => array($vendorDir . '/sabre/dav/lib/DAV'), - 'Sabre\\DAVACL\\' => array($vendorDir . '/sabre/dav/lib/DAVACL'), - 'Sabre\\CardDAV\\' => array($vendorDir . '/sabre/dav/lib/CardDAV'), - 'Sabre\\CalDAV\\' => array($vendorDir . '/sabre/dav/lib/CalDAV'), + 'Sabre\\' => array($vendorDir . '/sabre/dav/lib'), 'Ramsey\\Uuid\\' => array($vendorDir . '/ramsey/uuid/src'), 'Ramsey\\Collection\\' => array($vendorDir . '/ramsey/collection/src'), 'Punic\\' => array($vendorDir . '/punic/punic/src'), diff --git a/composer/autoload_static.php b/composer/autoload_static.php index 9048622ad..ddef0c9e7 100644 --- a/composer/autoload_static.php +++ b/composer/autoload_static.php @@ -191,10 +191,7 @@ class ComposerStaticInit2f23f73bc0cc116b4b1eee1521aa8652 'Sabre\\Uri\\' => 10, 'Sabre\\HTTP\\' => 11, 'Sabre\\Event\\' => 12, - 'Sabre\\DAV\\' => 10, - 'Sabre\\DAVACL\\' => 13, - 'Sabre\\CardDAV\\' => 14, - 'Sabre\\CalDAV\\' => 13, + 'Sabre\\' => 6, ), 'R' => array ( @@ -450,21 +447,9 @@ class ComposerStaticInit2f23f73bc0cc116b4b1eee1521aa8652 array ( 0 => __DIR__ . '/..' . '/sabre/event/lib', ), - 'Sabre\\DAV\\' => + 'Sabre\\' => array ( - 0 => __DIR__ . '/..' . '/sabre/dav/lib/DAV', - ), - 'Sabre\\DAVACL\\' => - array ( - 0 => __DIR__ . '/..' . '/sabre/dav/lib/DAVACL', - ), - 'Sabre\\CardDAV\\' => - array ( - 0 => __DIR__ . '/..' . '/sabre/dav/lib/CardDAV', - ), - 'Sabre\\CalDAV\\' => - array ( - 0 => __DIR__ . '/..' . '/sabre/dav/lib/CalDAV', + 0 => __DIR__ . '/..' . '/sabre/dav/lib', ), 'Ramsey\\Uuid\\' => array ( @@ -3078,6 +3063,7 @@ class ComposerStaticInit2f23f73bc0cc116b4b1eee1521aa8652 'Sabre\\DAV\\IMoveTarget' => __DIR__ . '/..' . '/sabre/dav/lib/DAV/IMoveTarget.php', 'Sabre\\DAV\\IMultiGet' => __DIR__ . '/..' . '/sabre/dav/lib/DAV/IMultiGet.php', 'Sabre\\DAV\\INode' => __DIR__ . '/..' . '/sabre/dav/lib/DAV/INode.php', + 'Sabre\\DAV\\INodeByPath' => __DIR__ . '/..' . '/sabre/dav/lib/DAV/INodeByPath.php', 'Sabre\\DAV\\IProperties' => __DIR__ . '/..' . '/sabre/dav/lib/DAV/IProperties.php', 'Sabre\\DAV\\IQuota' => __DIR__ . '/..' . '/sabre/dav/lib/DAV/IQuota.php', 'Sabre\\DAV\\Locks\\Backend\\AbstractBackend' => __DIR__ . '/..' . '/sabre/dav/lib/DAV/Locks/Backend/AbstractBackend.php', diff --git a/composer/installed.json b/composer/installed.json index e4ba0cca1..5d8a57dae 100644 --- a/composer/installed.json +++ b/composer/installed.json @@ -1678,17 +1678,17 @@ }, { "name": "icewind/searchdav", - "version": "v3.0.1", - "version_normalized": "3.0.1.0", + "version": "v3.1.0", + "version_normalized": "3.1.0.0", "source": { "type": "git", "url": "https://github.com/icewind1991/SearchDAV.git", - "reference": "52c8cfc21bd69271f224671c4924d260b0a8d4fb" + "reference": "8339181df313361da4daee6cb1c7f144f67f8492" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/icewind1991/SearchDAV/zipball/52c8cfc21bd69271f224671c4924d260b0a8d4fb", - "reference": "52c8cfc21bd69271f224671c4924d260b0a8d4fb", + "url": "https://api.github.com/repos/icewind1991/SearchDAV/zipball/8339181df313361da4daee6cb1c7f144f67f8492", + "reference": "8339181df313361da4daee6cb1c7f144f67f8492", "shasum": "" }, "require": { @@ -1702,7 +1702,7 @@ "phpunit/phpunit": "^8", "psalm/phar": "^4.3" }, - "time": "2022-04-11T13:02:49+00:00", + "time": "2023-11-14T22:32:04+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1723,7 +1723,7 @@ "description": "sabre/dav plugin to implement rfc5323 SEARCH", "support": { "issues": "https://github.com/icewind1991/SearchDAV/issues", - "source": "https://github.com/icewind1991/SearchDAV/tree/v3.0.1" + "source": "https://github.com/icewind1991/SearchDAV/tree/v3.1.0" }, "install-path": "../icewind/searchdav" }, @@ -3862,17 +3862,17 @@ }, { "name": "sabre/dav", - "version": "4.4.0", - "version_normalized": "4.4.0.0", + "version": "4.5.0", + "version_normalized": "4.5.0.0", "source": { "type": "git", "url": "https://github.com/sabre-io/dav.git", - "reference": "b65362abc926520eda2c57e219f022a6c288069d" + "reference": "7e40343e473f17eab3d1d6ca4ae3e1cdfc6e0fd8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sabre-io/dav/zipball/b65362abc926520eda2c57e219f022a6c288069d", - "reference": "b65362abc926520eda2c57e219f022a6c288069d", + "url": "https://api.github.com/repos/sabre-io/dav/zipball/7e40343e473f17eab3d1d6ca4ae3e1cdfc6e0fd8", + "reference": "7e40343e473f17eab3d1d6ca4ae3e1cdfc6e0fd8", "shasum": "" }, "require": { @@ -3895,18 +3895,18 @@ "sabre/xml": "^2.0.1" }, "require-dev": { - "evert/phpdoc-md": "~0.1.0", - "friendsofphp/php-cs-fixer": "^2.17.1", - "monolog/monolog": "^1.18", - "phpstan/phpstan": "^0.12", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.0" + "friendsofphp/php-cs-fixer": "^2.19", + "monolog/monolog": "^1.27", + "phpstan/phpstan": "^0.12 || ^1.0", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6" }, "suggest": { "ext-curl": "*", "ext-imap": "*", "ext-pdo": "*" }, - "time": "2022-06-27T09:07:55+00:00", + "time": "2023-11-14T10:48:05+00:00", "bin": [ "bin/sabredav", "bin/naturalselection" @@ -3915,10 +3915,7 @@ "installation-source": "dist", "autoload": { "psr-4": { - "Sabre\\DAV\\": "lib/DAV/", - "Sabre\\CalDAV\\": "lib/CalDAV/", - "Sabre\\DAVACL\\": "lib/DAVACL/", - "Sabre\\CardDAV\\": "lib/CardDAV/" + "Sabre\\": "lib/" } }, "notification-url": "https://packagist.org/downloads/", diff --git a/composer/installed.php b/composer/installed.php index 0838ef0d1..2c061f32b 100644 --- a/composer/installed.php +++ b/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'nextcloud/3rdparty', 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => 'b735a43181ab32f3d55783d7726589928db23745', + 'reference' => 'd7b9f6f5f0513adc3ed652eb84b1822fb5b53032', 'type' => 'library', 'install_path' => __DIR__ . '/../', 'aliases' => array(), @@ -209,9 +209,9 @@ 'dev_requirement' => false, ), 'icewind/searchdav' => array( - 'pretty_version' => 'v3.0.1', - 'version' => '3.0.1.0', - 'reference' => '52c8cfc21bd69271f224671c4924d260b0a8d4fb', + 'pretty_version' => 'v3.1.0', + 'version' => '3.1.0.0', + 'reference' => '8339181df313361da4daee6cb1c7f144f67f8492', 'type' => 'library', 'install_path' => __DIR__ . '/../icewind/searchdav', 'aliases' => array(), @@ -310,7 +310,7 @@ 'nextcloud/3rdparty' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => 'b735a43181ab32f3d55783d7726589928db23745', + 'reference' => 'd7b9f6f5f0513adc3ed652eb84b1822fb5b53032', 'type' => 'library', 'install_path' => __DIR__ . '/../', 'aliases' => array(), @@ -590,9 +590,9 @@ ), ), 'sabre/dav' => array( - 'pretty_version' => '4.4.0', - 'version' => '4.4.0.0', - 'reference' => 'b65362abc926520eda2c57e219f022a6c288069d', + 'pretty_version' => '4.5.0', + 'version' => '4.5.0.0', + 'reference' => '7e40343e473f17eab3d1d6ca4ae3e1cdfc6e0fd8', 'type' => 'library', 'install_path' => __DIR__ . '/../sabre/dav', 'aliases' => array(), diff --git a/icewind/searchdav/src/DAV/QueryParser.php b/icewind/searchdav/src/DAV/QueryParser.php index 440b64424..915184e31 100644 --- a/icewind/searchdav/src/DAV/QueryParser.php +++ b/icewind/searchdav/src/DAV/QueryParser.php @@ -76,6 +76,7 @@ public function __construct() { '{DAV:}contains' => Operator::class, '{DAV:}not' => Operator::class, '{DAV:}is-collection' => Operator::class, + '{DAV:}is-defined' => Operator::class, '{DAV:}limit' => Limit::class, ]; } diff --git a/sabre/dav/lib/CalDAV/Backend/AbstractBackend.php b/sabre/dav/lib/CalDAV/Backend/AbstractBackend.php index c32c86489..c761bff51 100644 --- a/sabre/dav/lib/CalDAV/Backend/AbstractBackend.php +++ b/sabre/dav/lib/CalDAV/Backend/AbstractBackend.php @@ -78,7 +78,7 @@ public function getMultipleCalendarObjects($calendarId, array $uris) * * This default may well be good enough for personal use, and calendars * that aren't very large. But if you anticipate high usage, big calendars - * or high loads, you are strongly adviced to optimize certain paths. + * or high loads, you are strongly advised to optimize certain paths. * * The best way to do so is override this method and to optimize * specifically for 'common filters'. @@ -95,7 +95,7 @@ public function getMultipleCalendarObjects($calendarId, array $uris) * Note that especially time-range-filters may be difficult to parse. A * time-range filter specified on a VEVENT must for instance also handle * recurrence rules correctly. - * A good example of how to interprete all these filters can also simply + * A good example of how to interpret all these filters can also simply * be found in \Sabre\CalDAV\CalendarQueryFilter. This class is as correct * as possible, so it gives you a good idea on what type of stuff you need * to think of. diff --git a/sabre/dav/lib/CalDAV/Backend/PDO.php b/sabre/dav/lib/CalDAV/Backend/PDO.php index 2f48ab982..b9f112cf8 100644 --- a/sabre/dav/lib/CalDAV/Backend/PDO.php +++ b/sabre/dav/lib/CalDAV/Backend/PDO.php @@ -939,7 +939,7 @@ public function getCalendarObjectByUID($principalUri, $uid) * @param int $syncLevel * @param int $limit * - * @return array + * @return array|null */ public function getChangesForCalendar($calendarId, $syncToken, $syncLevel, $limit = null) { diff --git a/sabre/dav/lib/CalDAV/Backend/SyncSupport.php b/sabre/dav/lib/CalDAV/Backend/SyncSupport.php index c7f67d176..bfc1dafc2 100644 --- a/sabre/dav/lib/CalDAV/Backend/SyncSupport.php +++ b/sabre/dav/lib/CalDAV/Backend/SyncSupport.php @@ -77,7 +77,7 @@ interface SyncSupport extends BackendInterface * @param int $syncLevel * @param int $limit * - * @return array + * @return array|null */ public function getChangesForCalendar($calendarId, $syncToken, $syncLevel, $limit = null); } diff --git a/sabre/dav/lib/CalDAV/Calendar.php b/sabre/dav/lib/CalDAV/Calendar.php index 6e989314d..6c0bf5411 100644 --- a/sabre/dav/lib/CalDAV/Calendar.php +++ b/sabre/dav/lib/CalDAV/Calendar.php @@ -186,17 +186,17 @@ public function createDirectory($name) * The contents of the new file must be a valid ICalendar string. * * @param string $name - * @param resource $calendarData + * @param resource $data * * @return string|null */ - public function createFile($name, $calendarData = null) + public function createFile($name, $data = null) { - if (is_resource($calendarData)) { - $calendarData = stream_get_contents($calendarData); + if (is_resource($data)) { + $data = stream_get_contents($data); } - return $this->caldavBackend->createCalendarObject($this->calendarInfo['id'], $name, $calendarData); + return $this->caldavBackend->createCalendarObject($this->calendarInfo['id'], $name, $data); } /** @@ -442,7 +442,7 @@ public function getSyncToken() * @param int $syncLevel * @param int $limit * - * @return array + * @return array|null */ public function getChanges($syncToken, $syncLevel, $limit = null) { diff --git a/sabre/dav/lib/CalDAV/CalendarHome.php b/sabre/dav/lib/CalDAV/CalendarHome.php index 159ddcc67..49c54a37a 100644 --- a/sabre/dav/lib/CalDAV/CalendarHome.php +++ b/sabre/dav/lib/CalDAV/CalendarHome.php @@ -96,10 +96,10 @@ public function getLastModified() * * This is currently not allowed * - * @param string $filename + * @param string $name * @param resource $data */ - public function createFile($filename, $data = null) + public function createFile($name, $data = null) { throw new DAV\Exception\MethodNotAllowed('Creating new files in this collection is not supported'); } diff --git a/sabre/dav/lib/CalDAV/Schedule/IMipPlugin.php b/sabre/dav/lib/CalDAV/Schedule/IMipPlugin.php index e050ac273..dcaf951ef 100644 --- a/sabre/dav/lib/CalDAV/Schedule/IMipPlugin.php +++ b/sabre/dav/lib/CalDAV/Schedule/IMipPlugin.php @@ -30,13 +30,6 @@ class IMipPlugin extends DAV\ServerPlugin */ protected $senderEmail; - /** - * ITipMessage. - * - * @var ITip\Message - */ - protected $itipMessage; - /** * Creates the email handler. * diff --git a/sabre/dav/lib/CalDAV/Schedule/Plugin.php b/sabre/dav/lib/CalDAV/Schedule/Plugin.php index 3cc360f1d..5e5659610 100644 --- a/sabre/dav/lib/CalDAV/Schedule/Plugin.php +++ b/sabre/dav/lib/CalDAV/Schedule/Plugin.php @@ -605,10 +605,9 @@ public function getSupportedPrivilegeSet(INode $node, array &$supportedPrivilege * * This method may update $newObject to add any status changes. * - * @param VCalendar|string $oldObject - * @param array $ignore any addresses to not send messages to - * @param bool $modified a marker to indicate that the original object - * modified by this process + * @param VCalendar|string|null $oldObject + * @param array $ignore any addresses to not send messages to + * @param bool $modified a marker to indicate that the original object modified by this process */ protected function processICalendarChange($oldObject, VCalendar $newObject, array $addresses, array $ignore = [], &$modified = false) { @@ -969,7 +968,7 @@ protected function getFreeBusyForEmail($email, \DateTimeInterface $start, \DateT * * @return bool */ - private function scheduleReply(RequestInterface $request) + protected function scheduleReply(RequestInterface $request) { $scheduleReply = $request->getHeader('Schedule-Reply'); diff --git a/sabre/dav/lib/CalDAV/Xml/Filter/PropFilter.php b/sabre/dav/lib/CalDAV/Xml/Filter/PropFilter.php index c9a3cb5ac..f1d66cc0d 100644 --- a/sabre/dav/lib/CalDAV/Xml/Filter/PropFilter.php +++ b/sabre/dav/lib/CalDAV/Xml/Filter/PropFilter.php @@ -53,7 +53,7 @@ public static function xmlDeserialize(Reader $reader) 'is-not-defined' => false, 'param-filters' => [], 'text-match' => null, - 'time-range' => false, + 'time-range' => [], ]; $att = $reader->parseAttributes(); diff --git a/sabre/dav/lib/CardDAV/AddressBook.php b/sabre/dav/lib/CardDAV/AddressBook.php index 86994f2d5..f5744f644 100644 --- a/sabre/dav/lib/CardDAV/AddressBook.php +++ b/sabre/dav/lib/CardDAV/AddressBook.php @@ -129,19 +129,19 @@ public function createDirectory($name) * This method may return an ETag. * * @param string $name - * @param resource $vcardData + * @param resource $data * * @return string|null */ - public function createFile($name, $vcardData = null) + public function createFile($name, $data = null) { - if (is_resource($vcardData)) { - $vcardData = stream_get_contents($vcardData); + if (is_resource($data)) { + $data = stream_get_contents($data); } // Converting to UTF-8, if needed - $vcardData = DAV\StringUtil::ensureUTF8($vcardData); + $data = DAV\StringUtil::ensureUTF8($data); - return $this->carddavBackend->createCard($this->addressBookInfo['id'], $name, $vcardData); + return $this->carddavBackend->createCard($this->addressBookInfo['id'], $name, $data); } /** @@ -317,7 +317,7 @@ public function getSyncToken() * @param int $syncLevel * @param int $limit * - * @return array + * @return array|null */ public function getChanges($syncToken, $syncLevel, $limit = null) { diff --git a/sabre/dav/lib/CardDAV/AddressBookHome.php b/sabre/dav/lib/CardDAV/AddressBookHome.php index 884e9b24e..d7365fbe8 100644 --- a/sabre/dav/lib/CardDAV/AddressBookHome.php +++ b/sabre/dav/lib/CardDAV/AddressBookHome.php @@ -92,10 +92,10 @@ public function getLastModified() * * This is currently not allowed * - * @param string $filename + * @param string $name * @param resource $data */ - public function createFile($filename, $data = null) + public function createFile($name, $data = null) { throw new DAV\Exception\MethodNotAllowed('Creating new files in this collection is not supported'); } diff --git a/sabre/dav/lib/CardDAV/Backend/PDO.php b/sabre/dav/lib/CardDAV/Backend/PDO.php index 966d7ba09..4ca9284a9 100644 --- a/sabre/dav/lib/CardDAV/Backend/PDO.php +++ b/sabre/dav/lib/CardDAV/Backend/PDO.php @@ -452,7 +452,7 @@ public function deleteCard($addressBookId, $cardUri) * @param int $syncLevel * @param int $limit * - * @return array + * @return array|null */ public function getChangesForAddressBook($addressBookId, $syncToken, $syncLevel, $limit = null) { diff --git a/sabre/dav/lib/CardDAV/Backend/SyncSupport.php b/sabre/dav/lib/CardDAV/Backend/SyncSupport.php index 071361ed0..6aaad1415 100644 --- a/sabre/dav/lib/CardDAV/Backend/SyncSupport.php +++ b/sabre/dav/lib/CardDAV/Backend/SyncSupport.php @@ -77,7 +77,7 @@ interface SyncSupport extends BackendInterface * @param int $syncLevel * @param int $limit * - * @return array + * @return array|null */ public function getChangesForAddressBook($addressBookId, $syncToken, $syncLevel, $limit = null); } diff --git a/sabre/dav/lib/CardDAV/Xml/Request/AddressBookMultiGetReport.php b/sabre/dav/lib/CardDAV/Xml/Request/AddressBookMultiGetReport.php index c11d2dd73..491f96908 100644 --- a/sabre/dav/lib/CardDAV/Xml/Request/AddressBookMultiGetReport.php +++ b/sabre/dav/lib/CardDAV/Xml/Request/AddressBookMultiGetReport.php @@ -38,7 +38,7 @@ class AddressBookMultiGetReport implements XmlDeserializable public $hrefs; /** - * The mimetype of the content that should be returend. Usually + * The mimetype of the content that should be returned. Usually * text/vcard. * * @var string @@ -53,6 +53,13 @@ class AddressBookMultiGetReport implements XmlDeserializable */ public $version = null; + /** + * An array with requested vcard properties. + * + * @var array + */ + public $addressDataProperties; + /** * The deserialize method is called during xml parsing. * diff --git a/sabre/dav/lib/DAV/INodeByPath.php b/sabre/dav/lib/DAV/INodeByPath.php new file mode 100644 index 000000000..4d63a33bd --- /dev/null +++ b/sabre/dav/lib/DAV/INodeByPath.php @@ -0,0 +1,36 @@ +rootNode; } - // Attempting to fetch its parent - list($parentName, $baseName) = Uri\split($path); + $parts = explode('/', $path); + $node = $this->rootNode; - // If there was no parent, we must simply ask it from the root node. - if ('' === $parentName) { - $node = $this->rootNode->getChild($baseName); - } else { - // Otherwise, we recursively grab the parent and ask him/her. - $parent = $this->getNodeForPath($parentName); - - if (!($parent instanceof ICollection)) { + while (count($parts)) { + if (!($node instanceof ICollection)) { throw new Exception\NotFound('Could not find node at path: '.$path); } - $node = $parent->getChild($baseName); + + if ($node instanceof INodeByPath) { + $targetNode = $node->getNodeForPath(implode('/', $parts)); + if ($targetNode instanceof Node) { + $node = $targetNode; + break; + } + } + + $part = array_shift($parts); + if ('' !== $part) { + $node = $node->getChild($part); + } } $this->cache[$path] = $node; diff --git a/sabre/dav/lib/DAV/Version.php b/sabre/dav/lib/DAV/Version.php index c6273ef72..97566524f 100644 --- a/sabre/dav/lib/DAV/Version.php +++ b/sabre/dav/lib/DAV/Version.php @@ -16,5 +16,5 @@ class Version /** * Full version number. */ - public const VERSION = '4.4.0'; + public const VERSION = '4.5.0'; } diff --git a/sabre/dav/lib/DAV/Xml/Element/Response.php b/sabre/dav/lib/DAV/Xml/Element/Response.php index 79f06a09b..df9291465 100644 --- a/sabre/dav/lib/DAV/Xml/Element/Response.php +++ b/sabre/dav/lib/DAV/Xml/Element/Response.php @@ -40,7 +40,7 @@ class Response implements Element * * This is currently only used in WebDAV-Sync * - * @var string + * @var string|null */ protected $httpStatus; @@ -112,13 +112,21 @@ public function getResponseProperties() */ public function xmlSerialize(Writer $writer) { - if ($status = $this->getHTTPStatus()) { - $writer->writeElement('{DAV:}status', 'HTTP/1.1 '.$status.' '.\Sabre\HTTP\Response::$statusCodes[$status]); - } + /* + * Accordingly to the RFC the element looks like: + * + * + * So the response + * - MUST contain a href and + * - EITHER a status and additional href(s) + * OR one or more propstat(s) + */ $writer->writeElement('{DAV:}href', $writer->contextUri.\Sabre\HTTP\encodePath($this->getHref())); $empty = true; + $httpStatus = $this->getHTTPStatus(); + // Add propstat elements foreach ($this->getResponseProperties() as $status => $properties) { // Skipping empty lists if (!$properties || (!is_int($status) && !ctype_digit($status))) { @@ -130,19 +138,25 @@ public function xmlSerialize(Writer $writer) $writer->writeElement('{DAV:}status', 'HTTP/1.1 '.$status.' '.\Sabre\HTTP\Response::$statusCodes[$status]); $writer->endElement(); // {DAV:}propstat } + + // The WebDAV spec only allows the status element on responses _without_ a propstat if ($empty) { - /* - * The WebDAV spec _requires_ at least one DAV:propstat to appear for - * every DAV:response. In some circumstances however, there are no - * properties to encode. - * - * In those cases we MUST specify at least one DAV:propstat anyway, with - * no properties. - */ - $writer->writeElement('{DAV:}propstat', [ - '{DAV:}prop' => [], - '{DAV:}status' => 'HTTP/1.1 418 '.\Sabre\HTTP\Response::$statusCodes[418], - ]); + if (null !== $httpStatus) { + $writer->writeElement('{DAV:}status', 'HTTP/1.1 '.$httpStatus.' '.\Sabre\HTTP\Response::$statusCodes[$httpStatus]); + } else { + /* + * The WebDAV spec _requires_ at least one DAV:propstat to appear for + * every DAV:response if there is no status. + * In some circumstances however, there are no properties to encode. + * + * In those cases we MUST specify at least one DAV:propstat anyway, with + * no properties. + */ + $writer->writeElement('{DAV:}propstat', [ + '{DAV:}prop' => [], + '{DAV:}status' => 'HTTP/1.1 418 '.\Sabre\HTTP\Response::$statusCodes[418], + ]); + } } } diff --git a/sabre/dav/lib/DAVACL/PrincipalBackend/BackendInterface.php b/sabre/dav/lib/DAVACL/PrincipalBackend/BackendInterface.php index 7140a9295..2fd31913d 100644 --- a/sabre/dav/lib/DAVACL/PrincipalBackend/BackendInterface.php +++ b/sabre/dav/lib/DAVACL/PrincipalBackend/BackendInterface.php @@ -48,7 +48,7 @@ public function getPrincipalsByPrefix($prefixPath); public function getPrincipalByPath($path); /** - * Updates one ore more webdav properties on a principal. + * Updates one or more webdav properties on a principal. * * The list of mutations is stored in a Sabre\DAV\PropPatch object. * To do the actual updates, you must tell this object which properties