summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-03-04 15:27:31 +0100
committerVincent Petry <pvince81@owncloud.com>2016-03-04 15:34:35 +0100
commit152e2e361d2710060bad5205a5a1059042f78f36 (patch)
tree70a2bf3de0cea2176e956d5629483afa3daf686a
parent78f40de83535dc42acd1a007281f1ea9bdfa3b98 (diff)
downloadnextcloud-server-152e2e361d2710060bad5205a5a1059042f78f36.tar.gz
nextcloud-server-152e2e361d2710060bad5205a5a1059042f78f36.zip
Properly check path validity before deleting to trash
This prevents deleting the whole "files" folder of the user whenever $ownerPath is empty. This can happen in concurrency situations.
-rw-r--r--apps/files_trashbin/lib/trashbin.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/files_trashbin/lib/trashbin.php b/apps/files_trashbin/lib/trashbin.php
index 64f3506b8c9..0d7ad1a423e 100644
--- a/apps/files_trashbin/lib/trashbin.php
+++ b/apps/files_trashbin/lib/trashbin.php
@@ -180,7 +180,7 @@ class Trashbin {
$ownerView = new \OC\Files\View('/' . $owner);
// file has been deleted in between
- if (!$ownerView->file_exists('/files/' . $ownerPath)) {
+ if (is_null($ownerPath) || $ownerPath === '' || !$ownerView->file_exists('/files/' . $ownerPath)) {
return true;
}