diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-03-04 15:27:31 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2016-03-04 15:27:31 +0100 |
commit | 0eb5292aaf0ea4c18a3811c561c28faa614b430d (patch) | |
tree | c169c115fc3334668072a6cff5c74d25039a966d /apps/files_trashbin | |
parent | bcc200cf9bb18ecb385ef617488555bdcc598312 (diff) | |
download | nextcloud-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.php | 2 |
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; } |