diff --git a/lib/Cake/Test/Case/Utility/FolderTest.php b/lib/Cake/Test/Case/Utility/FolderTest.php index 2664d16fe..99b7a3d3f 100644 --- a/lib/Cake/Test/Case/Utility/FolderTest.php +++ b/lib/Cake/Test/Case/Utility/FolderTest.php @@ -476,6 +476,9 @@ class FolderTest extends CakeTestCase { $result = $Folder->tree(null, true); $this->assertEquals($expected, $result); + $result = $Folder->tree(null, array('.')); + $this->assertEquals($expected, $result); + $expected = array( array( $Folder->path, diff --git a/lib/Cake/Utility/Folder.php b/lib/Cake/Utility/Folder.php index fa9e821fd..d523ea7d3 100644 --- a/lib/Cake/Utility/Folder.php +++ b/lib/Cake/Utility/Folder.php @@ -413,10 +413,6 @@ class Folder { if (is_array($exceptions)) { $exceptions = array_flip($exceptions); - if (isset($exceptions['.'])) { - $skipHidden = true; - unset($exceptions['.']); - } } $skipHidden = false; if ($exceptions === true) { @@ -435,7 +431,7 @@ class Folder { } return array(); } - $pathLength = strlen($path); + foreach ($iterator as $itemPath => $fsIterator) { if ($skipHidden) { $subPathName = $fsIterator->getSubPathname();