=== modified file 'drupal/sites/all/modules/filefield_paths/filefield_paths.module'
--- drupal/sites/all/modules/filefield_paths/filefield_paths.module	2012-02-02 11:29:40 +0000
+++ drupal/sites/all/modules/filefield_paths/filefield_paths.module	2012-12-03 12:14:23 +0000
@@ -75,11 +75,17 @@
  * Implements hook_init().
  */
 function filefield_paths_init() {
-  foreach (module_list() as $module) {
-    if (file_exists($file = drupal_get_path('module', 'filefield_paths') . '/modules/' . $module . '.inc')) {
-      require_once $file;
-    }
-  }
+  $directory = drupal_get_path('module', 'filefield_paths') . '/modules/';
+ 
+  //get all include files with a .inc extension.
+  $includes = glob($directory . "*.inc");
+
+  foreach (module_list() as $module) {
+    $file = $directory . $module . '.inc';
+    if (in_array($file, $includes)) {
+      require_once $file;
+    }
+  }
 }
 
 /**