summaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin/lib/storage.php
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-01-21 16:29:52 +0100
committerVincent Petry <pvince81@owncloud.com>2015-01-23 12:20:54 +0100
commit67f1534e0fd7c14e97fe5b17bd92aa2277520604 (patch)
tree52b863953936295764a52036cebc1162a6507dfd /apps/files_trashbin/lib/storage.php
parent5fb8a4715d6ed34b1d94c5508700f3c488c0f734 (diff)
downloadnextcloud-server-67f1534e0fd7c14e97fe5b17bd92aa2277520604.tar.gz
nextcloud-server-67f1534e0fd7c14e97fe5b17bd92aa2277520604.zip
Call final unlink in trash wrapper's storage
In the case of cross-storage delete, the files are copied to the trash, then deleted. The final delete on the source storage would still reach the trash wrapper. This fix makes forwards that second call to the wrapped storage to make the final delete work. It fixes the issue with remote shares, local shares and external storage. Also, it uses a new function "renameRecursive" that renames the files and preserves the mtimes (like "copy_recursive" did in the past))
Diffstat (limited to 'apps/files_trashbin/lib/storage.php')
-rw-r--r--apps/files_trashbin/lib/storage.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/apps/files_trashbin/lib/storage.php b/apps/files_trashbin/lib/storage.php
index aa5d48b5fbe..5036a260d0c 100644
--- a/apps/files_trashbin/lib/storage.php
+++ b/apps/files_trashbin/lib/storage.php
@@ -46,6 +46,9 @@ class Storage extends Wrapper {
if (count($parts) > 3 && $parts[2] === 'files') {
$filesPath = implode('/', array_slice($parts, 3));
$result = \OCA\Files_Trashbin\Trashbin::move2trash($filesPath);
+ // in cross-storage cases the file will be copied
+ // but not deleted, so we delete it here
+ $this->storage->unlink($path);
} else {
$result = $this->storage->unlink($path);
}