summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-01-23 14:19:36 +0100
committerRobin Appelman <icewind@owncloud.com>2015-01-23 14:19:36 +0100
commit91f3952ac1de6397057cc458f946617e90b69a18 (patch)
tree41bcfa0703bad87a59ec62b1df707dcae195fc62
parent960ff4f136dae689639d20a1a9f31a04e2961079 (diff)
downloadnextcloud-server-91f3952ac1de6397057cc458f946617e90b69a18.tar.gz
nextcloud-server-91f3952ac1de6397057cc458f946617e90b69a18.zip
Only move files from the current user to the trashbin
-rw-r--r--apps/files_trashbin/lib/storage.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/files_trashbin/lib/storage.php b/apps/files_trashbin/lib/storage.php
index 5036a260d0c..f51d2a2fb70 100644
--- a/apps/files_trashbin/lib/storage.php
+++ b/apps/files_trashbin/lib/storage.php
@@ -23,6 +23,7 @@
namespace OCA\Files_Trashbin;
+use OC\Files\Filesystem;
use OC\Files\Storage\Wrapper\Wrapper;
class Storage extends Wrapper {
@@ -38,13 +39,13 @@ class Storage extends Wrapper {
}
public function unlink($path) {
- $normalized = \OC\Files\Filesystem::normalizePath($this->mountPoint . '/' . $path);
+ $normalized = Filesystem::normalizePath($this->mountPoint . '/' . $path);
$result = true;
if (!isset($this->deletedFiles[$normalized])) {
+ $view = Filesystem::getView();
$this->deletedFiles[$normalized] = $normalized;
- $parts = explode('/', $normalized);
- if (count($parts) > 3 && $parts[2] === 'files') {
- $filesPath = implode('/', array_slice($parts, 3));
+ if ($filesPath = $view->getRelativePath($normalized)) {
+ $filesPath = trim($filesPath, '/');
$result = \OCA\Files_Trashbin\Trashbin::move2trash($filesPath);
// in cross-storage cases the file will be copied
// but not deleted, so we delete it here