summaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin
diff options
context:
space:
mode:
authorJuan Pablo Villafáñez <jvillafanez@solidgear.es>2017-01-25 17:21:20 +0100
committerMorris Jobke <hey@morrisjobke.de>2017-03-22 18:02:09 -0600
commit713faa0fc027d70136465c41c01d401e5d54a009 (patch)
tree7f0bfbedc83a652767f5441b86de186b7dd87fed /apps/files_trashbin
parentd551b8e6fdacd7659216b1e698b71840b569b525 (diff)
downloadnextcloud-server-713faa0fc027d70136465c41c01d401e5d54a009.tar.gz
nextcloud-server-713faa0fc027d70136465c41c01d401e5d54a009.zip
Use the expected method depending on the target being a file or folder
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps/files_trashbin')
-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;
}