summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2017-03-23 21:59:39 +0100
committerGitHub <noreply@github.com>2017-03-23 21:59:39 +0100
commit6e6cbae37c6a9e36b8f91333a260ed6025bb3555 (patch)
treec7f5dc4e40aeceb306646e76f5c45ceca021a255 /apps
parenteee7e97a6e0b705f2181c88c3aeb00f664ce3e36 (diff)
parent713faa0fc027d70136465c41c01d401e5d54a009 (diff)
downloadnextcloud-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.php6
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;
}