From 764f1177efe7bafe5ab47b21968d4b0921c3896c Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 14 Dec 2005 20:10:45 +0000 Subject: - Patch #40631 by Chris Johnson: is_array() slower than isset() or empty(). --- modules/search/search.module | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/search') diff --git a/modules/search/search.module b/modules/search/search.module index 908509da9..2755b19eb 100644 --- a/modules/search/search.module +++ b/modules/search/search.module @@ -975,7 +975,7 @@ function search_form($action = '', $keys = '', $type = null, $prompt = null) { $form['basic']['inline']['submit'] = array('#type' => 'submit', '#value' => t('Search')); $form_module = module_invoke($type, 'search', 'form', $keys); - if (is_array($form_module)) { + if (isset($form_module) && is_array($form_module)) { $form = array_merge($form, $form_module); } @@ -991,7 +991,7 @@ function search_data($keys = NULL, $type = 'node') { if (isset($keys)) { if (module_hook($type, 'search')) { $results = module_invoke($type, 'search', 'search', $keys); - if (is_array($results) && count($results)) { + if (isset($results) && is_array($results) && count($results)) { $output .= '
'; foreach ($results as $entry) { $output .= theme('search_item', $entry, $type); -- cgit v1.2.3