diff --git a/cake/libs/folder.php b/cake/libs/folder.php index 748d51718..848713a0f 100644 --- a/cake/libs/folder.php +++ b/cake/libs/folder.php @@ -190,20 +190,15 @@ class Folder extends Object { * @access public */ function find($regexp_pattern = '.*', $sort = false) { - $data = $this->read($sort); + list($dirs, $files) = $this->read($sort); - if (!is_array($data)) { - return array(); - } - - list($dirs, $files) = $data; $found = array(); - foreach ($files as $file) { if (preg_match("/^{$regexp_pattern}$/i", $file)) { $found[] = $file; } } + return $found; } /**