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 bcc200cf9b
commit 0eb5292aaf
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;
}