Skip to content

Commit 960e1a7

Browse files
committed
fixup! Avoid duplicate queries and limit depth by default to 0
1 parent 7f40ef6 commit 960e1a7

1 file changed

Lines changed: 9 additions & 11 deletions

File tree

lib/DAV/WorkspacePlugin.php

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,15 @@ public function propFind(PropFind $propFind, INode $node) {
101101
}
102102

103103
$file = null;
104-
if ($propFind->getDepth() === $this->server->getHTTPDepth(0)) {
105-
$owner = $this->userId ?? $node->getFileInfo()->getStorage()->getOwner('');
106-
/** @var Folder[] $nodes */
107-
$nodes = $this->rootFolder->getUserFolder($owner)->getById($node->getId());
108-
if (count($nodes) > 0) {
109-
/** @var File $file */
110-
try {
111-
$file = $this->workspaceService->getFile($nodes[0]);
112-
} catch (StorageNotAvailableException $e) {
113-
// If a storage is not available we can for the propfind response assume that there is no rich workspace present
114-
}
104+
$owner = $this->userId ?? $node->getFileInfo()->getStorage()->getOwner('');
105+
/** @var Folder[] $nodes */
106+
$nodes = $this->rootFolder->getUserFolder($owner)->getById($node->getId());
107+
if (count($nodes) > 0) {
108+
/** @var File $file */
109+
try {
110+
$file = $this->workspaceService->getFile($nodes[0]);
111+
} catch (StorageNotAvailableException $e) {
112+
// If a storage is not available we can for the propfind response assume that there is no rich workspace present
115113
}
116114
}
117115

0 commit comments

Comments
 (0)