aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-03-28 17:25:54 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-03-28 17:25:54 +0000
commit841d4d70eb3cb363a249305c215f0439f1970684 (patch)
treebd62292bd0f5c35acfb4c599742392beda58c34d /engine/lib
parentad71c8f3e60cddbcdaaf21d15f5b8f3cca4cec15 (diff)
downloadelgg-841d4d70eb3cb363a249305c215f0439f1970684.tar.gz
elgg-841d4d70eb3cb363a249305c215f0439f1970684.tar.bz2
Corresponding fix for register_plugin_hook
git-svn-id: https://code.elgg.org/elgg/trunk@284 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/elgglib.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index 6a15f2e9a..90cd11360 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -682,16 +682,18 @@
$CONFIG->hooks = array();
} else if (!isset($CONFIG->hooks[$hook]) && !empty($hook)) {
$CONFIG->hooks[$hook] = array();
+ } else if (!isset($CONFIG->hooks[$hook][$entity_type]) && !empty($entity_type)) {
+ $CONFIG->hooks[$hook][$entity_type] = array();
}
- if (!empty($hook) && is_callable($function)) {
+ if (!empty($hook) && !empty($entity_type) && is_callable($function)) {
$priority = (int) $priority;
if ($priority < 0) $priority = 0;
- while (isset($CONFIG->hooks[$hook][$priority])) {
+ while (isset($CONFIG->hooks[$hook][$entity_type][$priority])) {
$priority++;
}
- $CONFIG->hooks[$hook][$priority] = $function;
- ksort($CONFIG->hooks[$hook]);
+ $CONFIG->hooks[$hook][$entity_type][$priority] = $function;
+ ksort($CONFIG->hooks[$hook][$entity_type]);
return true;
} else {
return false;