Skip to content

Commit

Permalink
Skip . and .. when generating trees.
Browse files Browse the repository at this point in the history
Fixes #2012
  • Loading branch information
markstory committed Sep 23, 2011
1 parent 0bcb8d0 commit 1559683
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/Cake/Utility/Folder.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -413,6 +413,9 @@ public function tree($path = null, $exceptions = true, $type = null) {
if ($skipHidden && $name[0] === '.' || isset($exceptions[$name])) { if ($skipHidden && $name[0] === '.' || isset($exceptions[$name])) {
continue; continue;
} }
if ($name === '.' || $name === '..') {
continue;
}
if ($item->isFile()) { if ($item->isFile()) {
$files[] = $item->getPathName(); $files[] = $item->getPathName();
} else if ($item->isDir()) { } else if ($item->isDir()) {
Expand Down

0 comments on commit 1559683

Please sign in to comment.