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.
This commit is contained in:
Vincent Petry 2016-03-04 15:27:31 +01:00
parent 0655f25406
commit 96d45e90dc
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}