From b4a6cf35fe8c637cec5be811f109f6f841456283 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Mon, 6 Oct 2008 18:39:36 +0000 Subject: Added some code to ignore empty folders when deleting directories --- system/helpers/file_helper.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'system/helpers/file_helper.php') diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php index 58951823b..6378784f4 100644 --- a/system/helpers/file_helper.php +++ b/system/helpers/file_helper.php @@ -132,7 +132,11 @@ if ( ! function_exists('delete_files')) { if (is_dir($path.'/'.$filename)) { - delete_files($path.'/'.$filename, $del_dir, $level + 1); + // Ignore empty folders + if (substr($filename, 0, 1) != '.') + { + delete_files($path.'/'.$filename, $del_dir, $level + 1); + } } else { -- cgit v1.2.3-24-g4f1b