]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Using max() to give priority a minimum value of 0 for plugin hooks
authorewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 10 Nov 2010 22:27:04 +0000 (22:27 +0000)
committerewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 10 Nov 2010 22:27:04 +0000 (22:27 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7285 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/elgglib.php

index dc39a620485bcc85e23a45bd24660491568dd92a..26c6be743b6de6714c5fcae5985a615cd235e425 100644 (file)
@@ -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++;