diff options
author | vlakoff <vlakoff@gmail.com> | 2012-09-13 05:19:59 +0200 |
---|---|---|
committer | vlakoff <vlakoff@gmail.com> | 2012-09-13 05:19:59 +0200 |
commit | 8280885499ca4b1cffacc9ad78a9eff07a84de25 (patch) | |
tree | 4fe5c64156f6ab19468a9f1fa9e3713737866ff7 | |
parent | 88e3857ec2328e1dc4168c8343367d9d9e54d019 (diff) |
directory_map() was skipping files and directories named "0"
Close #1757. Thanks @BennyC!
-rw-r--r-- | system/helpers/directory_helper.php | 2 | ||||
-rw-r--r-- | tests/codeigniter/helpers/directory_helper_test.php | 4 | ||||
-rw-r--r-- | user_guide_src/source/changelog.rst | 1 |
3 files changed, 5 insertions, 2 deletions
diff --git a/system/helpers/directory_helper.php b/system/helpers/directory_helper.php index e7d3b5e8a..7d6b6770e 100644 --- a/system/helpers/directory_helper.php +++ b/system/helpers/directory_helper.php @@ -62,7 +62,7 @@ if ( ! function_exists('directory_map')) while (FALSE !== ($file = readdir($fp))) { // Remove '.', '..', and hidden files [optional] - if ( ! trim($file, '.') OR ($hidden === FALSE && $file[0] === '.')) + if ($file === '.' OR $file === '..' OR ($hidden === FALSE && $file[0] === '.')) { continue; } diff --git a/tests/codeigniter/helpers/directory_helper_test.php b/tests/codeigniter/helpers/directory_helper_test.php index 176ff1d78..c39ccd8d0 100644 --- a/tests/codeigniter/helpers/directory_helper_test.php +++ b/tests/codeigniter/helpers/directory_helper_test.php @@ -19,6 +19,7 @@ class Directory_helper_test extends CI_TestCase { 'benchmark.html' => '', 'database' => array('active_record.html' => '', 'binds.html' => ''), 'email.html' => '', + '0' => '', '.hiddenfile.txt' => '' ) ); @@ -30,7 +31,8 @@ class Directory_helper_test extends CI_TestCase { 'libraries' => array( 'benchmark.html', 'database' => array('active_record.html', 'binds.html'), - 'email.html' + 'email.html', + '0' ) ); diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 481afeee3..66dd0ea05 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -341,6 +341,7 @@ Bug fixes for 3.0 - Fixed a bug (#1605) - :doc:`Pagination Library <libraries/pagination>` produced incorrect *previous* and *next* link values. - Fixed a bug in SQLSRV's ``affected_rows()`` method where an erroneous function name was used. - Fixed a bug (#1000) - Change syntax of ``$view_file`` to ``$_ci_view_file`` to prevent being overwritten by application. +- Fixed a bug (#1757) - :doc:`Directory Helper <helpers/directory_helper>` function ``directory_map()`` was skipping files and directories named *0*. Version 2.1.2 ============= |