diff options
author | Derek Jones <derek.jones@ellislab.com> | 2008-01-29 21:20:00 +0100 |
---|---|---|
committer | Derek Jones <derek.jones@ellislab.com> | 2008-01-29 21:20:00 +0100 |
commit | 1c8dd3ad67bfa8da796bc0ebbfdf72be8d5bafb1 (patch) | |
tree | 32d0b615edb8a8e6c8c1342f57180f7688e42db3 /system | |
parent | 11c75eab4d04b9c88b0096015fb3c0711555bf9a (diff) |
fixed bug #3314 where the top level path would be deleted along with files in delete_files()
Diffstat (limited to 'system')
-rw-r--r-- | system/helpers/file_helper.php | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php index bbf340930..ef07de76c 100644 --- a/system/helpers/file_helper.php +++ b/system/helpers/file_helper.php @@ -122,7 +122,7 @@ if (! function_exists('delete_files')) {
// Trim the trailing slash
$path = preg_replace("|^(.+?)/*$|", "\\1", $path);
-
+
if ( ! $current_dir = @opendir($path))
return;
@@ -132,8 +132,7 @@ if (! function_exists('delete_files')) {
if (is_dir($path.'/'.$filename))
{
- $level++;
- delete_files($path.'/'.$filename, $del_dir, $level);
+ delete_files($path.'/'.$filename, $del_dir, $level + 1);
}
else
{
|