Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/text.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authordassio <dassio@icloud.com>2020-08-28 20:01:45 +0300
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2020-09-01 16:42:06 +0300
commit88890d36fb4332a44cc3989f76f3141f07835f73 (patch)
tree5c478ca6ecfad35a58b19aae73dc01bdf2a0aaf6 /lib
parent24e522a5d0795ac4301865f1ae1b93be044ada3b (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.php32
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 '';
+ });
+ }
}
}