Skip to content

Commit 3748987

Browse files
committed
Adding fix from davidpersson: sort not working for subdirectories in Folder::findRecursive
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8102 3807eeeb-6ff5-0310-8944-8be069107fe0
1 parent e89bc0b commit 3748987

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cake/libs/folder.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,17 +212,18 @@ function findRecursive($pattern = '.*', $sort = false) {
212212
*/
213213
function _findRecursive($pattern, $sort = false) {
214214
list($dirs, $files) = $this->read($sort);
215-
216215
$found = array();
216+
217217
foreach ($files as $file) {
218218
if (preg_match('/^' . $pattern . '$/i', $file)) {
219219
$found[] = Folder::addPathElement($this->path, $file);
220220
}
221221
}
222222
$start = $this->path;
223+
223224
foreach ($dirs as $dir) {
224225
$this->cd(Folder::addPathElement($start, $dir));
225-
$found = array_merge($found, $this->findRecursive($pattern));
226+
$found = array_merge($found, $this->findRecursive($pattern, $sort));
226227
}
227228
return $found;
228229
}

0 commit comments

Comments
 (0)