Skip to content

Commit d18b10c

Browse files
authored
Merge pull request #54632 from nextcloud/fix/fix-trashbin-plugin-dot-not-allowed
fix(trashbin): Fix errors in the log on MOVE operations
2 parents 983fd30 + 5c9c2fe commit d18b10c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

apps/files_trashbin/lib/Sabre/TrashbinPlugin.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Sabre\DAV\ServerPlugin;
2121
use Sabre\HTTP\RequestInterface;
2222
use Sabre\HTTP\ResponseInterface;
23+
use Sabre\Uri;
2324

2425
class TrashbinPlugin extends ServerPlugin {
2526
public const TRASHBIN_FILENAME = '{http://nextcloud.org/ns}trashbin-filename';
@@ -146,7 +147,8 @@ public function httpGet(RequestInterface $request, ResponseInterface $response):
146147
public function beforeMove(string $sourcePath, string $destinationPath): bool {
147148
try {
148149
$node = $this->server->tree->getNodeForPath($sourcePath);
149-
$destinationNodeParent = $this->server->tree->getNodeForPath(dirname($destinationPath));
150+
[$destinationDir, ] = Uri\split($destinationPath);
151+
$destinationNodeParent = $this->server->tree->getNodeForPath($destinationDir);
150152
} catch (\Sabre\DAV\Exception $e) {
151153
\OCP\Server::get(LoggerInterface::class)
152154
->error($e->getMessage(), ['app' => 'files_trashbin', 'exception' => $e]);

0 commit comments

Comments
 (0)