From 96d45e90dcab48992d7ab122b8e25f1d31361ea5 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Fri, 4 Mar 2016 15:27:31 +0100 Subject: [PATCH] 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 bcd73639d3..46447908b9 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; }