From 96e175ffbf6f209274395309e5b55ed724c5c2da Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B6rn=20Schie=C3=9Fle?= Date: Thu, 25 Jul 2013 16:27:40 +0200 Subject: [PATCH] don't move empty folders to the trash bin --- apps/files_trashbin/lib/trash.php | 5 +++++ 1 file changed, 5 insertions(+) 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'; -- 2.39.5