From 2ff9c7cc768a900338337f8a8e750915db77f29d Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 28 Jan 2014 03:58:53 -0800 Subject: [PATCH] Fix for PHP warning in 'search' shortcode. --- e107_core/shortcodes/single/search.sc | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/e107_core/shortcodes/single/search.sc b/e107_core/shortcodes/single/search.sc index c433fe6b9..1b992e290 100644 --- a/e107_core/shortcodes/single/search.sc +++ b/e107_core/shortcodes/single/search.sc @@ -21,14 +21,21 @@ if (!isset($SEARCH_SHORTCODE)) $ref['downloads'] = 3; $ref['pages'] = 4; - $search_prefs = $sysprefs -> getArray('search_prefs'); +// $search_prefs = $sysprefs -> getArray('search_prefs'); + + $search_prefs = e107::getConfig('search')->getPref(); - foreach ($search_prefs['plug_handlers'] as $plug_dir => $active) { - if (is_readable(e_PLUGIN.$plug_dir."/e_search.php")) { - $ref[$plug_dir] = $plug_dir; + + if(is_array($search_prefs['plug_handlers'])) + { + foreach ($search_prefs['plug_handlers'] as $plug_dir => $active) + { + if (is_readable(e_PLUGIN.$plug_dir."/e_search.php")) + { + $ref[$plug_dir] = $plug_dir; + } } } - if($ref[$parm]!= ''){ $page = $ref[$parm]; }elseif($parm='all' && $ref[e_PAGE] != ''){