Permalink
Browse files

Skip . and .. when generating trees.

Fixes #2012
  • Loading branch information...
1 parent 0bcb8d0 commit 155968349f47a67c4af764d40927e47daa5fa738 @markstory markstory committed Sep 23, 2011
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/Cake/Utility/Folder.php
@@ -413,6 +413,9 @@ public function tree($path = null, $exceptions = true, $type = null) {
if ($skipHidden && $name[0] === '.' || isset($exceptions[$name])) {
continue;
}
+ if ($name === '.' || $name === '..') {
+ continue;
+ }
if ($item->isFile()) {
$files[] = $item->getPathName();
} else if ($item->isDir()) {

0 comments on commit 1559683

Please sign in to comment.