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
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2020-09-01 16:41:49 +0300
committerGitHub <noreply@github.com>2020-09-01 16:41:49 +0300
commit4c1a73edbce66b112e87b182f6a01f570f12d4d8 (patch)
treed09b6c6da371b9ce0bff777f2b64887a4e2e5952
parent4cc041028814051d5a3bd56759d8825a97db0032 (diff)
parentda600dc39be3ae130117205e012025c1adb949e7 (diff)
Merge pull request #994 from dassio/ignore_rich_workspace_depth_0v20.0.0beta3
only return rich workspace when depth is 1 or greater
-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 '';
+ });
+ }
}
}