diff options
author | ewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-11-10 22:27:04 +0000 |
---|---|---|
committer | ewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-11-10 22:27:04 +0000 |
commit | 8a3732cd1e5cbdb0787c7b711640b7fddd728060 (patch) | |
tree | 083eae28ddd619e709cb0fcecdd7d44603d73aa3 | |
parent | c8f6c3c934df01bf969e3d91ae67f0887de10da9 (diff) | |
download | elgg-8a3732cd1e5cbdb0787c7b711640b7fddd728060.tar.gz elgg-8a3732cd1e5cbdb0787c7b711640b7fddd728060.tar.bz2 |
Using max() to give priority a minimum value of 0 for plugin hooks
git-svn-id: http://code.elgg.org/elgg/trunk@7285 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r-- | engine/lib/elgglib.php | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index dc39a6204..26c6be743 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -948,10 +948,7 @@ function elgg_register_plugin_hook_handler($hook, $type, $callback, $priority = return FALSE; } - $priority = (int) $priority; - if ($priority < 0) { - $priority = 0; - } + $priority = max((int) $priority, 0); while (isset($CONFIG->hooks[$hook][$type][$priority])) { $priority++; |