Skip to content

Commit 95b918c

Browse files
committed
SymlinkPlugin: Pass correct object to symlinkManager for httpDelete
1 parent 1a7ffed commit 95b918c

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

apps/dav/lib/Upload/SymlinkPlugin.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,20 @@ public function httpPut(RequestInterface $request, ResponseInterface $response):
7373
$response->setStatus(201);
7474
return false;
7575
}
76+
return true;
7677
}
7778

7879
public function httpDelete(RequestInterface $request, ResponseInterface $response): bool {
7980
$path = $request->getPath();
8081
$node = $this->server->tree->getNodeForPath(dirname($path));
81-
if ($this->symlinkManager->isSymlink($node)) {
82-
$this->symlinkManager->deleteSymlink($node);
83-
return false;
82+
if (!$node instanceof \OCA\DAV\Connector\Sabre\File) {
83+
return true;
84+
}
85+
$info = $node->getFileInfo();
86+
if ($this->symlinkManager->isSymlink($info)) {
87+
$this->symlinkManager->deleteSymlink($info);
8488
}
89+
// always propagate to trigger deletion of regular file representing symlink in filesystem
90+
return true;
8591
}
8692
}

0 commit comments

Comments
 (0)