From 152e2e361d2710060bad5205a5a1059042f78f36 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Fri, 4 Mar 2016 15:27:31 +0100 Subject: 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. --- apps/files_trashbin/lib/trashbin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- cgit v1.2.3