Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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"
Expand Down
6 changes: 6 additions & 0 deletions sabre/dav/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
------------------

Expand Down
24 changes: 10 additions & 14 deletions sabre/dav/lib/DAV/CorePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/*
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 3 additions & 1 deletion sabre/dav/lib/DAV/Tree.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand Down