summaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin
diff options
context:
space:
mode:
authorSteven Bühner <buehner@me.com>2016-09-05 14:24:04 +0200
committerLukas Reschke <lukas@statuscode.ch>2016-09-20 12:07:00 +0200
commit2b37dc9c9e2c60461057e72a295eef7fdda6e8b4 (patch)
treeaa1cca67d8905482edc4f9d7eeed13db1909fb46 /apps/files_trashbin
parent55fe036dbf953c8cc41888c6e5809f5604249b92 (diff)
downloadnextcloud-server-2b37dc9c9e2c60461057e72a295eef7fdda6e8b4.tar.gz
nextcloud-server-2b37dc9c9e2c60461057e72a295eef7fdda6e8b4.zip
Always use the same relative Path (Starting from users home dir. i.e.: "/files_trashbin/...")
Diffstat (limited to 'apps/files_trashbin')
-rw-r--r--apps/files_trashbin/lib/Trashbin.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php
index 4a4ff190edf..7c3797f420c 100644
--- a/apps/files_trashbin/lib/Trashbin.php
+++ b/apps/files_trashbin/lib/Trashbin.php
@@ -472,8 +472,12 @@ class Trashbin {
$view = new View('/' . $user);
$fileInfos = $view->getDirectoryContent('files_trashbin/files');
- foreach($fileInfos as $fileInfo){
- $path = $view->getRelativePath($fileInfo->getPath());
+ // Array to store the relative path in (after the file is deleted, the view won't be able to relativise the path anymore)
+ $filePaths = array();
+
+ foreach($fileInfos as $key => $fileInfo){
+ $filePaths[] = $path = $view->getRelativePath($fileInfo->getPath());
+ unset($fileInfo[$key]); // save memory
self::emitTrashbinPreDelete($path);
}
@@ -481,8 +485,7 @@ class Trashbin {
$query = \OC_DB::prepare('DELETE FROM `*PREFIX*files_trash` WHERE `user`=?');
$query->execute(array($user));
- foreach($fileInfos as $fileInfo){
- $path = $view->getRelativePath($fileInfo->getPath());
+ foreach($filePaths as $path){
self::emitTrashbinPostDelete($path);
}