From 55cc02bc08af49f554ee575a908ac0383ef9e949 Mon Sep 17 00:00:00 2001 From: mark_story Date: Mon, 16 Feb 2009 00:45:50 +0000 Subject: [PATCH] Fixing other uses of glob() to check for false values. Fixes #6044 git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8034 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/folder.php | 4 ++++ cake/tests/lib/test_manager.php | 2 ++ 2 files changed, 6 insertions(+) diff --git a/cake/libs/folder.php b/cake/libs/folder.php index 3911f884f..7bf8716ef 100644 --- a/cake/libs/folder.php +++ b/cake/libs/folder.php @@ -526,6 +526,10 @@ class Folder extends Object { if (is_dir($path) === true) { $normalFiles = glob($path . '*'); $hiddenFiles = glob($path . '\.?*'); + + $normalFiles = $normalFiles ? $normalFiles : array(); + $hiddenFiles = $hiddenFiles ? $hiddenFiles : array(); + $files = array_merge($normalFiles, $hiddenFiles); if (is_array($files)) { foreach ($files as $file) { diff --git a/cake/tests/lib/test_manager.php b/cake/tests/lib/test_manager.php index cd7558f02..d614ed6d0 100644 --- a/cake/tests/lib/test_manager.php +++ b/cake/tests/lib/test_manager.php @@ -277,6 +277,8 @@ class TestManager { } $files = glob($directory . DS . '*'); + $files = $files ? $files : array(); + foreach ($files as $file) { if (is_dir($file)) { $fileList = array_merge($fileList, $this->_getRecursiveFileList($file, $fileTestFunction));