]> source.dussan.org Git - nextcloud-server.git/commitdiff
don't move empty folders to the trash bin
authorBjörn Schießle <schiessle@owncloud.com>
Thu, 25 Jul 2013 14:27:40 +0000 (16:27 +0200)
committerBjörn Schießle <schiessle@owncloud.com>
Thu, 25 Jul 2013 14:27:40 +0000 (16:27 +0200)
apps/files_trashbin/lib/trash.php

index cf6587ef549b38c40c322ec4b3a87bb965f30503..50fdaccfb1efe0366a139b22dba50bb4c0c4bc0d 100644 (file)
@@ -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';