Merge pull request #3998 from nextcloud/backport-27032

Use the expected method depending on the target being a file or folder
This commit is contained in:
Roeland Jago Douma 2017-03-23 21:59:39 +01:00 committed by GitHub
commit 6e6cbae37c
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
if ($sourceStorage->is_dir($sourceInternalPath)) {
$sourceStorage->rmdir($sourceInternalPath);
} else {
$sourceStorage->unlink($sourceInternalPath);
}
return false;
}