Index: includes/file.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/file.inc,v
retrieving revision 1.87
diff -u -p -r1.87 file.inc
--- includes/file.inc	7 Dec 2006 17:02:25 -0000	1.87
+++ includes/file.inc	11 Dec 2006 12:12:56 -0000
@@ -603,7 +603,7 @@ function file_download() {
 
 /**
  * Finds all files that match a given mask in a given
- * directory.
+ * directory. Directories and files beginning with a period are excluded.
  *
  * @param $dir
  *   The base directory for the scan.
@@ -637,7 +637,7 @@ function file_scan_directory($dir, $mask
 
   if (is_dir($dir) && $handle = opendir($dir)) {
     while ($file = readdir($handle)) {
-      if (!in_array($file, $nomask)) {
+      if (!in_array($file, $nomask) && $file[0] != '.') {
         if (is_dir("$dir/$file") && $recurse) {
           $files = array_merge($files, file_scan_directory("$dir/$file", $mask, $nomask, $callback, $recurse, $key, $min_depth, $depth + 1));
         }
