]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix trash error when deleting files with the same name at the same time (happens...
authorRobin Appelman <icewind@owncloud.com>
Wed, 28 Jan 2015 14:16:55 +0000 (15:16 +0100)
committerRobin Appelman <icewind@owncloud.com>
Wed, 28 Jan 2015 14:16:55 +0000 (15:16 +0100)
apps/files_trashbin/lib/trashbin.php

index 4086bb1216dcfa6f23cbcf3072f10b6f1d4eff56..0576be66b4b9016ab1cf8bb942ffec175eeb97c1 100644 (file)
@@ -167,6 +167,9 @@ class Trashbin {
                $trashPath = '/files_trashbin/files/' . $filename . '.d' . $timestamp;
                try {
                        $sizeOfAddedFiles = $view->filesize('/files/' . $file_path);
+                       if ($view->file_exists($trashPath)) {
+                               $view->unlink($trashPath);
+                       }
                        $view->rename('/files/' . $file_path, $trashPath);
                } catch (\OCA\Files_Trashbin\Exceptions\CopyRecursiveException $e) {
                        $sizeOfAddedFiles = false;