From 8a3732cd1e5cbdb0787c7b711640b7fddd728060 Mon Sep 17 00:00:00 2001 From: ewinslow Date: Wed, 10 Nov 2010 22:27:04 +0000 Subject: 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 --- engine/lib/elgglib.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'engine') 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++; -- cgit v1.2.3