summaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin
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:27:31 +0100
commit0eb5292aaf0ea4c18a3811c561c28faa614b430d (patch)
treec169c115fc3334668072a6cff5c74d25039a966d /apps/files_trashbin
parentbcc200cf9bb18ecb385ef617488555bdcc598312 (diff)
downloadnextcloud-server-0eb5292aaf0ea4c18a3811c561c28faa614b430d.tar.gz
nextcloud-server-0eb5292aaf0ea4c18a3811c561c28faa614b430d.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.
Diffstat (limited to 'apps/files_trashbin')
-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 bcd73639d3c..46447908b90 100644
--- a/apps/files_trashbin/lib/trashbin.php
+++ b/apps/files_trashbin/lib/trashbin.php
@@ -204,7 +204,7 @@ class Trashbin {
$ownerView = new 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;
}