summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;
}