From bd699a928b61b74e28bb1d50ca26fcafde43e5a3 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Thu, 11 Apr 2019 20:53:04 +0200 Subject: [PATCH] [stable14] Bump sabre/dav to 3.2.3 Signed-off-by: Roeland Jago Douma --- composer.json | 2 +- composer.lock | 12 ++++++------ composer/installed.json | 12 ++++++------ sabre/dav/CHANGELOG.md | 6 ++++++ sabre/dav/lib/DAV/CorePlugin.php | 24 ++++++++++-------------- sabre/dav/lib/DAV/Tree.php | 4 +++- 6 files changed, 32 insertions(+), 28 deletions(-) diff --git a/composer.json b/composer.json index 623c1ddcc..4f29639b6 100644 --- a/composer.json +++ b/composer.json @@ -39,7 +39,7 @@ "php-opencloud/openstack": "3.0.5", "pimple/pimple": "3.2.3", "punic/punic": "^1.6", - "sabre/dav": "^3.2.0", + "sabre/dav": "^3.2.3", "stecman/symfony-console-completion": "^0.7.0", "swiftmailer/swiftmailer": "^6.0", "symfony/console": "3.4.12", diff --git a/composer.lock b/composer.lock index c87d1e24d..7e28f66ad 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": "0e5dceb33c26ee3cbbb6f74a758c64d6", + "content-hash": "7692b00a8c93de8d710f875c5793344b", "packages": [ { "name": "aws/aws-sdk-php", @@ -2490,16 +2490,16 @@ }, { "name": "sabre/dav", - "version": "3.2.2", + "version": "3.2.3", "source": { "type": "git", "url": "https://github.com/sabre-io/dav.git", - "reference": "e987775e619728f12205606c9cc3ee565ffb1516" + "reference": "a9780ce4f35560ecbd0af524ad32d9d2c8954b80" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sabre-io/dav/zipball/e987775e619728f12205606c9cc3ee565ffb1516", - "reference": "e987775e619728f12205606c9cc3ee565ffb1516", + "url": "https://api.github.com/repos/sabre-io/dav/zipball/a9780ce4f35560ecbd0af524ad32d9d2c8954b80", + "reference": "a9780ce4f35560ecbd0af524ad32d9d2c8954b80", "shasum": "" }, "require": { @@ -2569,7 +2569,7 @@ "framework", "iCalendar" ], - "time": "2017-02-15T03:06:08+00:00" + "time": "2018-10-19T09:58:27+00:00" }, { "name": "sabre/event", diff --git a/composer/installed.json b/composer/installed.json index 22b67a270..da058e9c5 100644 --- a/composer/installed.json +++ b/composer/installed.json @@ -2571,17 +2571,17 @@ }, { "name": "sabre/dav", - "version": "3.2.2", - "version_normalized": "3.2.2.0", + "version": "3.2.3", + "version_normalized": "3.2.3.0", "source": { "type": "git", "url": "https://github.com/sabre-io/dav.git", - "reference": "e987775e619728f12205606c9cc3ee565ffb1516" + "reference": "a9780ce4f35560ecbd0af524ad32d9d2c8954b80" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sabre-io/dav/zipball/e987775e619728f12205606c9cc3ee565ffb1516", - "reference": "e987775e619728f12205606c9cc3ee565ffb1516", + "url": "https://api.github.com/repos/sabre-io/dav/zipball/a9780ce4f35560ecbd0af524ad32d9d2c8954b80", + "reference": "a9780ce4f35560ecbd0af524ad32d9d2c8954b80", "shasum": "" }, "require": { @@ -2612,7 +2612,7 @@ "ext-curl": "*", "ext-pdo": "*" }, - "time": "2017-02-15T03:06:08+00:00", + "time": "2018-10-19T09:58:27+00:00", "bin": [ "bin/sabredav", "bin/naturalselection" diff --git a/sabre/dav/CHANGELOG.md b/sabre/dav/CHANGELOG.md index 0bccc995c..cda2564e1 100644 --- a/sabre/dav/CHANGELOG.md +++ b/sabre/dav/CHANGELOG.md @@ -1,6 +1,12 @@ ChangeLog ========= +3.2.3 (2018-10-19) +------------------ + +* #982: Make sure that files that are siblings of directories, are reported + as files (@nickvergessen) + 3.2.2 (2017-02-14) ------------------ diff --git a/sabre/dav/lib/DAV/CorePlugin.php b/sabre/dav/lib/DAV/CorePlugin.php index 95da21f4a..676cdd04a 100644 --- a/sabre/dav/lib/DAV/CorePlugin.php +++ b/sabre/dav/lib/DAV/CorePlugin.php @@ -82,18 +82,14 @@ function httpGet(RequestInterface $request, ResponseInterface $response) { if (!$node instanceof IFile) return; - if ($request->getHeader('X-Sabre-Original-Method') === 'HEAD') { - $body = ''; - } else { - $body = $node->get(); - - // Converting string into stream, if needed. - if (is_string($body)) { - $stream = fopen('php://temp', 'r+'); - fwrite($stream, $body); - rewind($stream); - $body = $stream; - } + $body = $node->get(); + + // Converting string into stream, if needed. + if (is_string($body)) { + $stream = fopen('php://temp', 'r+'); + fwrite($stream, $body); + rewind($stream); + $body = $stream; } /* @@ -249,13 +245,13 @@ function httpOptions(RequestInterface $request, ResponseInterface $response) { function httpHead(RequestInterface $request, ResponseInterface $response) { // This is implemented by changing the HEAD request to a GET request, - // and telling the request handler that is doesn't need to create the body. + // and dropping the response body. $subRequest = clone $request; $subRequest->setMethod('GET'); - $subRequest->setHeader('X-Sabre-Original-Method', 'HEAD'); try { $this->server->invokeMethod($subRequest, $response, false); + $response->setBody(''); } catch (Exception\NotImplemented $e) { // Some clients may do HEAD requests on collections, however, GET // requests and HEAD requests _may_ not be defined on a collection, diff --git a/sabre/dav/lib/DAV/Tree.php b/sabre/dav/lib/DAV/Tree.php index 5d2792503..7c04f0915 100644 --- a/sabre/dav/lib/DAV/Tree.php +++ b/sabre/dav/lib/DAV/Tree.php @@ -298,7 +298,9 @@ function getMultipleNodes($paths) { */ protected function copyNode(INode $source, ICollection $destinationParent, $destinationName = null) { - if (!$destinationName) $destinationName = $source->getName(); + if ((string)$destinationName === '') { + $destinationName = $source->getName(); + } if ($source instanceof IFile) {