Index: includes/bootstrap.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v
retrieving revision 1.429
diff -u -p -r1.429 bootstrap.inc
--- includes/bootstrap.inc	15 Oct 2010 18:03:43 -0000	1.429
+++ includes/bootstrap.inc	17 Oct 2010 16:35:51 -0000
@@ -713,7 +713,7 @@ function drupal_get_filename($type, $nam
       // extension, not just the file we are currently looking for. This
       // prevents unnecessary scans from being repeated when this function is
       // called more than once in the same page request.
-      $matches = drupal_system_listing("/\.$extension$/", $dir, 'name', 0);
+      $matches = drupal_system_listing("/^[a-z][a-z0-9_]*\.$extension$/", $dir, 'name', 0);
       foreach ($matches as $matched_name => $file) {
         $files[$type][$matched_name] = $file->uri;
       }
Index: includes/install.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/install.inc,v
retrieving revision 1.142
diff -u -p -r1.142 install.inc
--- includes/install.inc	22 Aug 2010 15:31:18 -0000	1.142
+++ includes/install.inc	17 Oct 2010 16:38:24 -0000
@@ -524,7 +524,7 @@ function drupal_verify_profile($install_
 
   // Get a list of modules that exist in Drupal's assorted subdirectories.
   $present_modules = array();
-  foreach (drupal_system_listing('/\.module$/', 'modules', 'name', 0) as $present_module) {
+  foreach (drupal_system_listing('/^[a-z][a-z0-9_]*\.module$/', 'modules', 'name', 0) as $present_module) {
     $present_modules[] = $present_module->name;
   }
 
Index: includes/module.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/module.inc,v
retrieving revision 1.202
diff -u -p -r1.202 module.inc
--- includes/module.inc	3 Oct 2010 02:04:55 -0000	1.202
+++ includes/module.inc	17 Oct 2010 16:37:36 -0000
@@ -786,7 +786,7 @@ function module_invoke_all() {
  * Array of modules required by core.
  */
 function drupal_required_modules() {
-  $files = drupal_system_listing('/\.info$/', 'modules', 'name', 0);
+  $files = drupal_system_listing('/^[a-z][a-z0-9_]*\.info$/', 'modules', 'name', 0);
   $required = array();
 
   // An install profile is required and one must always be loaded.
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.981
diff -u -p -r1.981 system.module
--- modules/system/system.module	15 Oct 2010 04:40:41 -0000	1.981
+++ modules/system/system.module	17 Oct 2010 16:34:09 -0000
@@ -2278,7 +2278,7 @@ function system_get_info($type, $name = 
  */
 function _system_rebuild_module_data() {
   // Find modules
-  $modules = drupal_system_listing('/\.module$/', 'modules', 'name', 0);
+  $modules = drupal_system_listing('/^[a-z][a-z0-9_]*\.module$/', 'modules', 'name', 0);
 
   // Include the install profile in modules that are loaded.
   $profile = drupal_get_profile();
@@ -2398,9 +2398,9 @@ function _system_update_bootstrap_status
  */
 function _system_rebuild_theme_data() {
   // Find themes
-  $themes = drupal_system_listing('/\.info$/', 'themes');
+  $themes = drupal_system_listing('/^[a-z][a-z0-9_]*\.info$/', 'themes');
   // Find theme engines
-  $engines = drupal_system_listing('/\.engine$/', 'themes/engines');
+  $engines = drupal_system_listing('/^[a-z][a-z0-9_]*\.engine$/', 'themes/engines');
 
   // Set defaults for theme info.
   $defaults = array(
