--- search.module.1 2005-03-17 17:28:15.000000000 +0100 +++ search.module 2005-03-17 17:30:10.000000000 +0100 @@ -301,24 +301,10 @@ function search_keywords_variation($text * Invokes hook_search_preprocess() in modules. */ function search_preprocess(&$text) { - static $modules = null; - // Cache list of modules which implement this hook. This function gets called - // a lot during reindexing. - if (!is_array($modules)) { - $modules = array(); - foreach (module_list() as $module) { - if (module_hook($module, 'search_preprocess')) { - $modules[] = $module; - } - } - } - // Process $text - if (count($modules) > 0) { - foreach ($modules as $module) { + foreach (module_implements('search_preprocess') as $module) { $text = module_invoke($module, 'search_preprocess', $text); } } -} /**