summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDerek Jones <derek.jones@ellislab.com>2008-02-27 00:18:27 +0100
committerDerek Jones <derek.jones@ellislab.com>2008-02-27 00:18:27 +0100
commit2c6dda41c8207ffa704934a1fbde65769ce86992 (patch)
tree9e12d9733134ed4fb6a849c7d261601c2c0e368e
parent964366de070c20636d9037ff06d98081b9d1b0cc (diff)
fixed recursion in get_filenames() (bug #3523)
-rw-r--r--system/helpers/file_helper.php13
-rw-r--r--user_guide/changelog.html1
2 files changed, 10 insertions, 4 deletions
diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php
index 096d225d7..1b37af2fd 100644
--- a/system/helpers/file_helper.php
+++ b/system/helpers/file_helper.php
@@ -164,17 +164,22 @@ if (! function_exists('delete_files'))
*/
if (! function_exists('get_filenames'))
{
- function get_filenames($source_dir, $include_path = FALSE)
+ function get_filenames($source_dir, $include_path = FALSE, $recursion = FALSE)
{
- $_filedata = array();
-
+ static $_filedata = array();
+
+ if ($recursion === FALSE)
+ {
+ $_filedata = array();
+ }
+
if ($fp = @opendir($source_dir))
{
while (FALSE !== ($file = readdir($fp)))
{
if (@is_dir($source_dir.$file) && substr($file, 0, 1) != '.')
{
- get_filenames($source_dir.$file."/", $include_path);
+ get_filenames($source_dir.$file."/", $include_path, TRUE);
}
elseif (substr($file, 0, 1) != ".")
{
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index 3cf2ea8d9..80615aa2e 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -71,6 +71,7 @@ Change Log
<li>Fixed an AR_caching error where it wasn't tracking table aliases (#3463)</li>
<li>Fixed a bug in the DB class testing the $params argument</li>
<li>Fixed a bug in the Table library where the integer 0 in cell data would be displayed as a blank cell.</li>
+ <li>Fixed a bug (#3523) in get_filenames() with recursion.</p>
</ul>
<h2>Version 1.6.1</h2>
<p>Release Date: February 12, 2008</p>