From 0eb5292aaf0ea4c18a3811c561c28faa614b430d 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(-) (limited to 'apps') 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; } -- cgit v1.2.3