diff options
author | dassio <dassio@icloud.com> | 2020-08-28 20:01:45 +0300 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2020-09-01 16:42:06 +0300 |
commit | 88890d36fb4332a44cc3989f76f3141f07835f73 (patch) | |
tree | 5c478ca6ecfad35a58b19aae73dc01bdf2a0aaf6 /lib | |
parent | 24e522a5d0795ac4301865f1ae1b93be044ada3b (diff) |
do not return rich workspace when depth=0
Signed-off-by: dassio <dassio@icloud.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/DAV/WorkspacePlugin.php | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/lib/DAV/WorkspacePlugin.php b/lib/DAV/WorkspacePlugin.php index 79a8a393a..4118555c0 100644 --- a/lib/DAV/WorkspacePlugin.php +++ b/lib/DAV/WorkspacePlugin.php @@ -93,24 +93,24 @@ class WorkspacePlugin extends ServerPlugin { if (!$workspaceAvailable || !$workspaceEnabled) { return; } - - $propFind->handle(self::WORKSPACE_PROPERTY, function () use ($node) { - /** @var Folder[] $nodes */ - $nodes = $this->rootFolder->getUserFolder($this->userId)->getById($node->getId()); - if (count($nodes) > 0) { - /** @var File $file */ - try { - $file = $this->workspaceService->getFile($nodes[0]); - if ($file instanceof File) { - return $file->getContent(); - } - } catch (StorageNotAvailableException $e) { + if ($propFind->getDepth() > 0) { + $propFind->handle(self::WORKSPACE_PROPERTY, function () use ($node) { + /** @var Folder[] $nodes */ + $nodes = $this->rootFolder->getUserFolder($this->userId)->getById($node->getId()); + if (count($nodes) > 0) { + /** @var File $file */ + try { + $file = $this->workspaceService->getFile($nodes[0]); + if ($file instanceof File) { + return $file->getContent(); + } + } catch (StorageNotAvailableException $e) { // If a storage is not available we can for the propfind response assume that there is no rich workspace present + } } - } - return ''; - }); - + return ''; + }); + } } } |