From: Tim Otten Date: Thu, 30 May 2013 20:45:36 +0000 (-0400) Subject: CRM_Utils_File::findFiles -- Ignore other dot directories (like .git / .bzr) X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d7166b43c6448d39028b4e0fd9acbf658ed51fd2;p=civicrm-core.git CRM_Utils_File::findFiles -- Ignore other dot directories (like .git / .bzr) --- 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; }