Use the expected method depending on the target being a file or folder

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
Juan Pablo Villafáñez 2017-01-25 17:21:20 +01:00 committed by Morris Jobke
parent d551b8e6fd
commit 713faa0fc0
No known key found for this signature in database
GPG Key ID: 9CE5ED29E7FCD38A
1 changed files with 5 additions and 1 deletions

View File

@ -256,7 +256,11 @@ class Trashbin {
}
if ($sourceStorage->file_exists($sourceInternalPath)) { // failed to delete the original file, abort
$sourceStorage->unlink($sourceInternalPath);
if ($sourceStorage->is_dir($sourceInternalPath)) {
$sourceStorage->rmdir($sourceInternalPath);
} else {
$sourceStorage->unlink($sourceInternalPath);
}
return false;
}