Index: install.php =================================================================== RCS file: /cvs/drupal/drupal/install.php,v retrieving revision 1.1 diff -u -F^f -r1.1 install.php --- install.php 13 Jul 2006 13:11:36 -0000 1.1 +++ install.php 20 Jul 2006 14:07:14 -0000 @@ -304,7 +304,7 @@ function install_select_profile() { include_once './includes/file.inc'; include_once './includes/form.inc'; - $profiles = file_scan_directory('./profiles', '\.profile$', array('.', '..', 'CVS'), 0, TRUE, 'name', 0); + $profiles = file_scan_directory('./profiles', '\.profile$', '/(\.\.?|CVS)$/', 0, TRUE, 'name', 0); // Don't need to choose profile if only one available. if (sizeof($profiles) == 1) { $profile = array_pop($profiles); Index: ./includes/file.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/file.inc,v retrieving revision 1.79 diff -u -F^f -r1.79 file.inc --- ./includes/file.inc 5 Jul 2006 11:45:51 -0000 1.79 +++ ./includes/file.inc 20 Jul 2006 14:07:14 -0000 @@ -610,7 +610,7 @@ function file_download() { * @param $mask * The regular expression of the files to find. * @param $nomask - * An array of files/directories to ignore. + * The regular expression of the files to exclude. * @param $callback * The callback function to call for each match. * @param $recurse @@ -631,13 +631,13 @@ function file_download() { * "path", "basename", and "name" members corresponding to the * matching files. */ -function file_scan_directory($dir, $mask, $nomask = array('.', '..', 'CVS'), $callback = 0, $recurse = TRUE, $key = 'filename', $min_depth = 0, $depth = 0) { +function file_scan_directory($dir, $mask, $nomask = '/(\.\.?|CVS)$/', $callback = 0, $recurse = TRUE, $key = 'filename', $min_depth = 0, $depth = 0) { $key = (in_array($key, array('filename', 'basename', 'name')) ? $key : 'filename'); $files = array(); if (is_dir($dir) && $handle = opendir($dir)) { while ($file = readdir($handle)) { - if (!in_array($file, $nomask)) { + if (!preg_match($nomask, $file)) { if (is_dir("$dir/$file") && $recurse) { $files = array_merge($files, file_scan_directory("$dir/$file", $mask, $nomask, $callback, $recurse, $key, $min_depth, $depth + 1)); } Index: ./includes/install.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/install.inc,v retrieving revision 1.8 diff -u -F^f -r1.8 install.inc --- ./includes/install.inc 19 Jul 2006 07:45:35 -0000 1.8 +++ ./includes/install.inc 20 Jul 2006 14:07:14 -0000 @@ -246,7 +246,7 @@ function drupal_rewrite_settings($settin function drupal_get_install_files($module_list = array()) { $installs = array(); foreach ($module_list as $module) { - $installs = array_merge($installs, file_scan_directory('./modules', "^$module.install$", array('.', '..', 'CVS'), 0, TRUE, 'name', 0)); + $installs = array_merge($installs, file_scan_directory('./modules', "^$module.install$", '/(\.\.?|CVS)$/', 0, TRUE, 'name', 0)); } return $installs; } @@ -316,7 +316,7 @@ function drupal_install_profile($profile function drupal_find_modules($module_list = array()) { $modules = array(); foreach ($module_list as $current) { - $module = file_scan_directory('./modules', "^$current.module$", array('.', '..', 'CVS'), 0, TRUE, 'name', 0); + $module = file_scan_directory('./modules', "^$current.module$", '/(\.\.?|CVS)$/', 0, TRUE, 'name', 0); if (empty($module)) { drupal_set_message(st('The %module module is required but was not found. Please move the file %file into the modules subdirectory.', array('%module' => $current, '%file' => $current .'.module')), 'error'); } Index: ./modules/system/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.module,v retrieving revision 1.332 diff -u -F^f -r1.332 system.module --- ./modules/system/system.module 10 Jul 2006 21:12:09 -0000 1.332 +++ ./modules/system/system.module 20 Jul 2006 14:07:14 -0000 @@ -802,7 +802,7 @@ function system_listing($mask, $director // Get current list of items foreach ($searchdir as $dir) { - $files = array_merge($files, file_scan_directory($dir, $mask, array('.', '..', 'CVS'), 0, TRUE, $key, $min_depth)); + $files = array_merge($files, file_scan_directory($dir, $mask, '/(\.\.?|CVS)$/', 0, TRUE, $key, $min_depth)); } return $files;