summaryrefslogtreecommitdiffstats
path: root/system/helpers/file_helper.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/helpers/file_helper.php')
-rw-r--r--system/helpers/file_helper.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php
index 3834d4895..441345b05 100644
--- a/system/helpers/file_helper.php
+++ b/system/helpers/file_helper.php
@@ -109,7 +109,7 @@ if ( ! function_exists('delete_files'))
function delete_files($path, $del_dir = FALSE, $level = 0, $htdocs = FALSE)
{
// Trim the trailing slash
- $path = rtrim($path, DIRECTORY_SEPARATOR);
+ $path = rtrim($path, '/\\');
if ( ! $current_dir = @opendir($path))
{
@@ -124,7 +124,7 @@ if ( ! function_exists('delete_files'))
{
delete_files($path.DIRECTORY_SEPARATOR.$filename, $del_dir, $level + 1, $htdocs);
}
- elseif ($htdocs === TRUE && ! preg_match('/^(\.htaccess|index\.(html|htm|php)|web\.config)$/i', $filename))
+ elseif ($htdocs !== TRUE OR ! preg_match('/^(\.htaccess|index\.(html|htm|php)|web\.config)$/i', $filename))
{
@unlink($path.DIRECTORY_SEPARATOR.$filename);
}