- #19063: Use module_implements instead of hand-rolled routine.
							parent
							
								
									332a56334d
								
							
						
					
					
						commit
						ab7815c8cd
					
				| 
						 | 
					@ -301,24 +301,10 @@ function search_keywords_variation($text) {
 | 
				
			||||||
 * Invokes hook_search_preprocess() in modules.
 | 
					 * Invokes hook_search_preprocess() in modules.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
function search_preprocess(&$text) {
 | 
					function search_preprocess(&$text) {
 | 
				
			||||||
  static $modules = null;
 | 
					  foreach (module_implements('search_preprocess') as $module) {
 | 
				
			||||||
  // 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) {
 | 
					 | 
				
			||||||
    $text = module_invoke($module, 'search_preprocess', $text);
 | 
					    $text = module_invoke($module, 'search_preprocess', $text);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -301,24 +301,10 @@ function search_keywords_variation($text) {
 | 
				
			||||||
 * Invokes hook_search_preprocess() in modules.
 | 
					 * Invokes hook_search_preprocess() in modules.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
function search_preprocess(&$text) {
 | 
					function search_preprocess(&$text) {
 | 
				
			||||||
  static $modules = null;
 | 
					  foreach (module_implements('search_preprocess') as $module) {
 | 
				
			||||||
  // 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) {
 | 
					 | 
				
			||||||
    $text = module_invoke($module, 'search_preprocess', $text);
 | 
					    $text = module_invoke($module, 'search_preprocess', $text);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue