From 2c777acb25fd5355ec02dc74c428174df80310d0 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 22 Aug 2020 19:31:29 +0200 Subject: composer update sabre libs --- vendor/sabre/dav/CHANGELOG.md | 6 +++++ vendor/sabre/dav/composer.json | 2 +- vendor/sabre/dav/lib/DAV/Locks/Plugin.php | 2 +- vendor/sabre/dav/lib/DAV/Server.php | 6 +++-- vendor/sabre/dav/lib/DAV/Tree.php | 2 -- vendor/sabre/dav/lib/DAV/Version.php | 2 +- .../sabre/dav/tests/Sabre/DAV/AbstractServer.php | 2 +- .../sabre/dav/tests/Sabre/DAV/Locks/PluginTest.php | 26 ++++++++++++++++++++++ 8 files changed, 40 insertions(+), 8 deletions(-) (limited to 'vendor/sabre/dav') diff --git a/vendor/sabre/dav/CHANGELOG.md b/vendor/sabre/dav/CHANGELOG.md index 932827a72..c84a4f5e4 100644 --- a/vendor/sabre/dav/CHANGELOG.md +++ b/vendor/sabre/dav/CHANGELOG.md @@ -1,6 +1,12 @@ ChangeLog ========= +4.1.1 (2020-07-13) +------------------------- +* Fix PHPdoc of Tree:move method +* Allow using custom SAPI implementations +* Include baseUri in lock responses + 4.1.0 (2020-03-20) ------------------------- * Support PHP 7.4 diff --git a/vendor/sabre/dav/composer.json b/vendor/sabre/dav/composer.json index f0fbf7af7..d4190ae5d 100644 --- a/vendor/sabre/dav/composer.json +++ b/vendor/sabre/dav/composer.json @@ -33,7 +33,7 @@ "ext-json": "*" }, "require-dev" : { - "friendsofphp/php-cs-fixer": "~2.16.1", + "friendsofphp/php-cs-fixer": "^2.16.3", "phpstan/phpstan": "^0.12", "phpunit/phpunit" : "^7.5 || ^8.5 || ^9.0", "evert/phpdoc-md" : "~0.1.0", diff --git a/vendor/sabre/dav/lib/DAV/Locks/Plugin.php b/vendor/sabre/dav/lib/DAV/Locks/Plugin.php index 1e9b6839e..110bfce06 100644 --- a/vendor/sabre/dav/lib/DAV/Locks/Plugin.php +++ b/vendor/sabre/dav/lib/DAV/Locks/Plugin.php @@ -371,7 +371,7 @@ class Plugin extends DAV\ServerPlugin { return $this->server->xml->write('{DAV:}prop', [ '{DAV:}lockdiscovery' => new DAV\Xml\Property\LockDiscovery([$lockInfo]), - ]); + ], $this->server->getBaseUri()); } /** diff --git a/vendor/sabre/dav/lib/DAV/Server.php b/vendor/sabre/dav/lib/DAV/Server.php index 3c237500a..37bf282e8 100644 --- a/vendor/sabre/dav/lib/DAV/Server.php +++ b/vendor/sabre/dav/lib/DAV/Server.php @@ -208,8 +208,10 @@ class Server implements LoggerAwareInterface, EmitterInterface * the nodes in the array as top-level children. * * @param Tree|INode|array|null $treeOrNode The tree object + * + * @throws Exception */ - public function __construct($treeOrNode = null) + public function __construct($treeOrNode = null, HTTP\Sapi $sapi = null) { if ($treeOrNode instanceof Tree) { $this->tree = $treeOrNode; @@ -226,7 +228,7 @@ class Server implements LoggerAwareInterface, EmitterInterface } $this->xml = new Xml\Service(); - $this->sapi = new HTTP\Sapi(); + $this->sapi = $sapi ?? new HTTP\Sapi(); $this->httpResponse = new HTTP\Response(); $this->httpRequest = $this->sapi->getRequest(); $this->addPlugin(new CorePlugin()); diff --git a/vendor/sabre/dav/lib/DAV/Tree.php b/vendor/sabre/dav/lib/DAV/Tree.php index 72e14d522..aedc0155d 100644 --- a/vendor/sabre/dav/lib/DAV/Tree.php +++ b/vendor/sabre/dav/lib/DAV/Tree.php @@ -141,8 +141,6 @@ class Tree * * @param string $sourcePath The path to the file which should be moved * @param string $destinationPath The full destination path, so not just the destination parent node - * - * @return int */ public function move($sourcePath, $destinationPath) { diff --git a/vendor/sabre/dav/lib/DAV/Version.php b/vendor/sabre/dav/lib/DAV/Version.php index d2c4afb56..a7f5269bf 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.0'; + public const VERSION = '4.1.1'; } diff --git a/vendor/sabre/dav/tests/Sabre/DAV/AbstractServer.php b/vendor/sabre/dav/tests/Sabre/DAV/AbstractServer.php index 807b66382..49fedf062 100644 --- a/vendor/sabre/dav/tests/Sabre/DAV/AbstractServer.php +++ b/vendor/sabre/dav/tests/Sabre/DAV/AbstractServer.php @@ -14,7 +14,7 @@ abstract class AbstractServer extends \PHPUnit\Framework\TestCase protected $response; protected $request; /** - * @var Sabre\DAV\Server + * @var \Sabre\DAV\Server */ protected $server; protected $tempDir = SABRE_TEMPDIR; diff --git a/vendor/sabre/dav/tests/Sabre/DAV/Locks/PluginTest.php b/vendor/sabre/dav/tests/Sabre/DAV/Locks/PluginTest.php index 96e3939d0..9279afb5a 100644 --- a/vendor/sabre/dav/tests/Sabre/DAV/Locks/PluginTest.php +++ b/vendor/sabre/dav/tests/Sabre/DAV/Locks/PluginTest.php @@ -110,6 +110,32 @@ class PluginTest extends DAV\AbstractServer $this->assertEquals($this->response->getHeader('Lock-Token'), '<'.(string) $token[0].'>', 'Token in response body didn\'t match token in response header.'); } + public function testLockWithContext() + { + $request = new HTTP\Request('LOCK', '/baseuri/test.txt'); + $request->setBody(' + + + + + http://example.org/~ejw/contact.html + +'); + + $this->server->setBaseUri('baseuri'); + $this->server->httpRequest = $request; + $this->server->exec(); + + $this->assertEquals(200, $this->response->status, 'Got an incorrect status back. Response body: '.$this->response->getBodyAsString()); + + $body = preg_replace("/xmlns(:[A-Za-z0-9_])?=(\"|\')DAV:(\"|\')/", 'xmlns\\1="urn:DAV"', $this->response->getBodyAsString()); + $xml = simplexml_load_string($body); + $xml->registerXPathNamespace('d', 'urn:DAV'); + + $lockRoot = $xml->xpath('/d:prop/d:lockdiscovery/d:activelock/d:lockroot/d:href'); + $this->assertEquals('baseuri/test.txt', (string) $lockRoot[0]); + } + /** * @depends testLock */ -- cgit v1.2.3