X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fplugin.php;h=1044d456fda2af2bf52a8bb4f092491dcf3c37fc;hb=316c380a2f5f3495fc8f95f304514d4082b0aa8b;hp=9ffbe27c7dd334f53dd31c2d3899d05527678185;hpb=7587094b66211a881e31f06899146c7e3808a7f6;p=squirrelmail.git diff --git a/functions/plugin.php b/functions/plugin.php index 9ffbe27c..1044d456 100644 --- a/functions/plugin.php +++ b/functions/plugin.php @@ -7,7 +7,7 @@ * * Documentation on how to write plugins might show up some time. * - * @copyright © 1999-2007 The SquirrelMail Project Team + * @copyright 1999-2013 The SquirrelMail Project Team * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package squirrelmail @@ -58,7 +58,7 @@ function use_plugin ($name) { * independent of) the return value for this hook. * * @param string $name Name of hook being executed - * @param mixed $args A single value or an array of arguments + * @param mixed &$args A single value or an array of arguments * that are to be passed to all plugins * operating off the hook being called. * Note that this argument is passed by @@ -120,7 +120,7 @@ function do_hook($name, &$args) { * independent of) the return value for this hook. * * @param string $name Name of hook being executed - * @param mixed $args A single value or an array of arguments + * @param mixed &$args A single value or an array of arguments * that are to be passed to all plugins * operating off the hook being called. * Note that this argument is passed by @@ -187,7 +187,7 @@ function concat_hook_function($name, &$args, $force_array=FALSE) { * independent of) the return value for this hook. * * @param string $name The hook name - * @param mixed $args A single value or an array of arguments + * @param mixed &$args A single value or an array of arguments * that are to be passed to all plugins * operating off the hook being called. * Note that this argument is passed by @@ -975,8 +975,10 @@ function check_plugin_dependencies($plugin_name, $force_inclusion = FALSE) { $version = explode('.', substr($depend_requirements['version'], strpos($depend_requirements['version'], ':') + 1), 3); $version[0] = intval($version[0]); - $version[1] = intval($version[1]); - $version[2] = intval($version[2]); + if (isset($version[1])) $version[1] = intval($version[1]); + else $version[1] = 0; + if (isset($version[2])) $version[2] = intval($version[2]); + else $version[2] = 0; if (!check_sm_version($version[0], $version[1], $version[2])) $missing_or_bad[$depend_name] = $depend_requirements; @@ -1003,8 +1005,10 @@ function check_plugin_dependencies($plugin_name, $force_inclusion = FALSE) // $version = explode('.', $depend_requirements['version'], 3); $version[0] = intval($version[0]); - $version[1] = intval($version[1]); - $version[2] = intval($version[2]); + if (isset($version[1])) $version[1] = intval($version[1]); + else $version[1] = 0; + if (isset($version[2])) $version[2] = intval($version[2]); + else $version[2] = 0; $force_dependency_inclusion = !$depend_requirements['activate'];