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:34:35 +0100 |
commit | 152e2e361d2710060bad5205a5a1059042f78f36 (patch) | |
tree | 70a2bf3de0cea2176e956d5629483afa3daf686a | |
parent | 78f40de83535dc42acd1a007281f1ea9bdfa3b98 (diff) | |
download | nextcloud-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.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 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; } |