summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2016-06-22 11:42:44 +0200
committerAndrey Andreev <narf@devilix.net>2016-06-22 11:42:44 +0200
commitf7b028bf6db9c298db99cf800777ad3691b206b5 (patch)
tree1a521fd1bb8f597eeb6f11a693bd5182780232c8
parent343163624e2527df9ce0c22a6e4ccfebf5b9f48b (diff)
Fix #4675
-rw-r--r--system/helpers/file_helper.php8
-rw-r--r--user_guide_src/source/changelog.rst1
2 files changed, 6 insertions, 3 deletions
diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php
index 0d8d1d0d9..3cb36a551 100644
--- a/system/helpers/file_helper.php
+++ b/system/helpers/file_helper.php
@@ -138,13 +138,15 @@ if ( ! function_exists('delete_files'))
{
if ($filename !== '.' && $filename !== '..')
{
- if (is_dir($path.DIRECTORY_SEPARATOR.$filename) && $filename[0] !== '.')
+ $filepath = $path.DIRECTORY_SEPARATOR.$filename;
+
+ if (is_dir($filepath) && $filename[0] !== '.' && ! is_link($filepath))
{
- delete_files($path.DIRECTORY_SEPARATOR.$filename, $del_dir, $htdocs, $_level + 1);
+ delete_files($filepath, $del_dir, $htdocs, $_level + 1);
}
elseif ($htdocs !== TRUE OR ! preg_match('/^(\.htaccess|index\.(html|htm|php)|web\.config)$/i', $filename))
{
- @unlink($path.DIRECTORY_SEPARATOR.$filename);
+ @unlink($filepath);
}
}
}
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index 8774d4b84..da96b009e 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -35,6 +35,7 @@ Bug fixes for 3.0.7
- Fixed a bug where :doc:`Session Library <libraries/sessions>` 'redis' driver didn't properly detect if a connection is properly closed on PHP 5.x.
- Fixed a bug (#4583) - :doc:`Email Library <libraries/email>` didn't properly handle inline attachments in HTML emails.
- Fixed a bug where :doc:`Database <database/index>` method `db_select()` didn't clear metadata cached for the previously used database.
+- Fixed a bug (#4675) - :doc:`File Helper <helpers/file_helper>` function :php:func:`delete_files()` treated symbolic links as regular directories.
Version 3.0.6
=============