summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-07-25 16:27:40 +0200
committerBjörn Schießle <schiessle@owncloud.com>2013-07-25 16:27:40 +0200
commit96e175ffbf6f209274395309e5b55ed724c5c2da (patch)
tree7114a05657843fab4746ee946fbf4a3e41c00042
parentbf668eb14f460ca2dc8661236b533bc861116217 (diff)
downloadnextcloud-server-96e175ffbf6f209274395309e5b55ed724c5c2da.tar.gz
nextcloud-server-96e175ffbf6f209274395309e5b55ed724c5c2da.zip
don't move empty folders to the trash bin
-rw-r--r--apps/files_trashbin/lib/trash.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/files_trashbin/lib/trash.php b/apps/files_trashbin/lib/trash.php
index cf6587ef549..50fdaccfb1e 100644
--- a/apps/files_trashbin/lib/trash.php
+++ b/apps/files_trashbin/lib/trash.php
@@ -72,6 +72,11 @@ class Trashbin {
$mime = $view->getMimeType('files' . $file_path);
if ($view->is_dir('files' . $file_path)) {
+ $dirContent = $view->getDirectoryContent('files' . $file_path);
+ // no need to move empty folders to the trash bin
+ if (empty($dirContent)) {
+ return true;
+ }
$type = 'dir';
} else {
$type = 'file';