Merge pull request #54632 from nextcloud/fix/fix-trashbin-plugin-dot-not-allowed

fix(trashbin): Fix errors in the log on MOVE operations
pull/54197/head
Côme Chilliet 2025-08-26 08:33:58 +07:00 committed by GitHub
commit d18b10ca11
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

@ -20,6 +20,7 @@ use Sabre\DAV\Server;
use Sabre\DAV\ServerPlugin;
use Sabre\HTTP\RequestInterface;
use Sabre\HTTP\ResponseInterface;
use Sabre\Uri;
class TrashbinPlugin extends ServerPlugin {
public const TRASHBIN_FILENAME = '{http://nextcloud.org/ns}trashbin-filename';
@ -146,7 +147,8 @@ class TrashbinPlugin extends ServerPlugin {
public function beforeMove(string $sourcePath, string $destinationPath): bool {
try {
$node = $this->server->tree->getNodeForPath($sourcePath);
$destinationNodeParent = $this->server->tree->getNodeForPath(dirname($destinationPath));
[$destinationDir, ] = Uri\split($destinationPath);
$destinationNodeParent = $this->server->tree->getNodeForPath($destinationDir);
} catch (\Sabre\DAV\Exception $e) {
\OCP\Server::get(LoggerInterface::class)
->error($e->getMessage(), ['app' => 'files_trashbin', 'exception' => $e]);