We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 52c06ff commit 47bd460Copy full SHA for 47bd460
src/controllers/DeleteController.php
@@ -29,7 +29,7 @@ public function getDelete()
29
}
30
31
if (File::isDirectory($file_to_delete)) {
32
- if (sizeof(File::files($file_to_delete)) != 0) {
+ if (!parent::directoryIsEmpty($file_to_delete)) {
33
return $this->error('delete-folder');
34
35
src/traits/LfmHelpers.php
@@ -174,6 +174,11 @@ public function createFolderByPath($path)
174
175
176
177
+ public function directoryIsEmpty($directory_path)
178
+ {
179
+ return count(File::allFiles($directory_path)) == 0;
180
+ }
181
+
182
183
/****************************
184
*** Miscellaneouses ***
0 commit comments