Skip to content

Commit 0b67a0f

Browse files
committed
fix(dav): do not list intermediate upload folders
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent 7adeca3 commit 0b67a0f

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

apps/dav/lib/Upload/RootCollection.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public function __construct(
2424
private IUserSession $userSession,
2525
) {
2626
parent::__construct($principalBackend, $principalPrefix);
27+
$this->disableListing = true;
2728
}
2829

2930
/**

apps/dav/lib/Upload/UploadHome.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use OCP\Files\NotFoundException;
1515
use OCP\IUserSession;
1616
use Sabre\DAV\Exception\Forbidden;
17+
use Sabre\DAV\Exception\MethodNotAllowed;
1718
use Sabre\DAV\Exception\NotFound;
1819
use Sabre\DAV\ICollection;
1920

@@ -44,9 +45,7 @@ public function getChild($name): UploadFolder {
4445
}
4546

4647
public function getChildren(): array {
47-
return array_map(function ($node) {
48-
return new UploadFolder($node, $this->cleanupService, $this->getStorage());
49-
}, $this->impl()->getChildren());
48+
throw new MethodNotAllowed('Listing members of this collection is disabled');
5049
}
5150

5251
public function childExists($name): bool {

0 commit comments

Comments
 (0)