From d7166b43c6448d39028b4e0fd9acbf658ed51fd2 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 30 May 2013 16:45:36 -0400 Subject: [PATCH] CRM_Utils_File::findFiles -- Ignore other dot directories (like .git / .bzr) --- CRM/Utils/File.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CRM/Utils/File.php b/CRM/Utils/File.php index f1917a171a..44350a47d0 100644 --- a/CRM/Utils/File.php +++ b/CRM/Utils/File.php @@ -516,7 +516,9 @@ HTACCESS; } /** - * Search directory tree for files which match a glob pattern + * Search directory tree for files which match a glob pattern. + * + * Note: Dot-directories (like "..", ".git", or ".svn") will be ignored. * * @param $dir string, base dir * @param $pattern string, glob pattern, eg "*.txt" @@ -536,7 +538,8 @@ HTACCESS; if ($dh) { while (FALSE !== ($entry = readdir($dh))) { $path = $subdir . DIRECTORY_SEPARATOR . $entry; - if ($entry == '.' || $entry == '..' || $entry == '.svn') { + if ($entry{0} == '.') { + // ignore } elseif (is_dir($path)) { $todos[] = $path; } -- 2.25.1