diff options
author | dassio <dassio@icloud.com> | 2020-08-28 20:01:45 +0300 |
---|---|---|
committer | dassio <dassio@icloud.com> | 2020-08-31 17:35:41 +0300 |
commit | da600dc39be3ae130117205e012025c1adb949e7 (patch) | |
tree | d09b6c6da371b9ce0bff777f2b64887a4e2e5952 | |
parent | 4cc041028814051d5a3bd56759d8825a97db0032 (diff) |
do not return rich workspace when depth=0
Signed-off-by: dassio <dassio@icloud.com>
-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 ''; + }); + } } } |