From 696ed249c8cbca301ba63b1514413e3523e24876 Mon Sep 17 00:00:00 2001 From: cash Date: Thu, 16 Dec 2010 14:14:52 +0000 Subject: fixed a lot of notices being generated by the new plugin hook code git-svn-id: http://code.elgg.org/elgg/trunk@7645 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/elgglib.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'engine') diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index cbb9fbdc9..f4e487426 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -1078,12 +1078,17 @@ function unregister_plugin_hook($hook, $entity_type, $callback) { function elgg_trigger_plugin_hook($hook, $type, $params = null, $returnvalue = null) { global $CONFIG; - $hooks = array( - $CONFIG->hooks[$hook][$type], - $CONFIG->hooks['all'][$type], - $CONFIG->hooks[$hook]['all'], - $CONFIG->hooks['all']['all'], - ); + $hooks = array(); + if (isset($CONFIG->hooks[$hook][$type])) { + $hooks[] = $CONFIG->hooks[$hook][$type]; + } + if (isset($CONFIG->hooks['all'][$type])) { + $hooks[] = $CONFIG->hooks['all'][$type]; + } + if (isset($CONFIG->hooks[$hook]['all'])) { + $hooks[] = $CONFIG->hooks[$hook]['all']; + } + $hooks[] = $CONFIG->hooks['all']['all']; foreach ($hooks as $callback_list) { if (is_array($callback_list)) { -- cgit v1.2.3