diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2017-03-23 21:59:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-23 21:59:39 +0100 |
commit | 6e6cbae37c6a9e36b8f91333a260ed6025bb3555 (patch) | |
tree | c7f5dc4e40aeceb306646e76f5c45ceca021a255 /apps | |
parent | eee7e97a6e0b705f2181c88c3aeb00f664ce3e36 (diff) | |
parent | 713faa0fc027d70136465c41c01d401e5d54a009 (diff) | |
download | nextcloud-server-6e6cbae37c6a9e36b8f91333a260ed6025bb3555.tar.gz nextcloud-server-6e6cbae37c6a9e36b8f91333a260ed6025bb3555.zip |
Merge pull request #3998 from nextcloud/backport-27032
Use the expected method depending on the target being a file or folder
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_trashbin/lib/Trashbin.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php index 2e66a6b96e1..78f0c9212f9 100644 --- a/apps/files_trashbin/lib/Trashbin.php +++ b/apps/files_trashbin/lib/Trashbin.php @@ -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; } |