From: Björn Schießle Date: Thu, 25 Jul 2013 14:27:40 +0000 (+0200) Subject: don't move empty folders to the trash bin X-Git-Tag: v6.0.0alpha2~389^2~8 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=96e175ffbf6f209274395309e5b55ed724c5c2da;p=nextcloud-server.git don't move empty folders to the trash bin --- 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';