Merge pull request #911 from agh1/membership-dash-counts-new
[civicrm-core.git] / CRM / Utils / File.php
index f1917a171ae211fd3c9be2d874c0c3f48f082ca3..fca8353168cb2ed6aba523e66489c3046c5ba70a 100644 (file)
@@ -161,7 +161,7 @@ class CRM_Utils_File {
       if ($rmdir) {
         if (rmdir($target)) {
           if ($verbose) {
-               CRM_Core_Session::setStatus(ts('Removed directory %1', array(1 => $target)), '', 'success');
+            CRM_Core_Session::setStatus(ts('Removed directory %1', array(1 => $target)), '', 'success');
           }
           return TRUE;
       }
@@ -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;
           }