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:42:04 +0100 |
commit | da242962c3935573a1a04a5e523bf673f7da089d (patch) | |
tree | 02a58291636527391c207d34a94cac3c29a5e025 | |
parent | 519191bb052165880c92f74347bd0a950a45fa71 (diff) | |
download | nextcloud-server-da242962c3935573a1a04a5e523bf673f7da089d.tar.gz nextcloud-server-da242962c3935573a1a04a5e523bf673f7da089d.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.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 2898f849da4..25b0e43041a 100644 --- a/apps/files_trashbin/lib/trashbin.php +++ b/apps/files_trashbin/lib/trashbin.php @@ -153,7 +153,7 @@ class Trashbin { $view = new \OC\Files\View('/' . $user); // file has been deleted in between - if (!$view->file_exists('/files/' . $file_path)) { + if (is_null($ownerPath) || $ownerPath === '' || !$view->file_exists('/files/' . $file_path)) { return true; } |