X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=functions%2Fplugin.php;h=342d2ac428c156d442b2f61f9f6273cc0ee9f605;hp=2bc6bff060551e711419a499b3b9cbf3f9723900;hb=5fba72dbfda07d04597ac9e0d9e91b89779fa612;hpb=e900d242c297d00e54d8f8ca4a333100709b27a1 diff --git a/functions/plugin.php b/functions/plugin.php index 2bc6bff0..342d2ac4 100644 --- a/functions/plugin.php +++ b/functions/plugin.php @@ -141,8 +141,7 @@ function do_hook_function($name,$parm=NULL) { */ function concat_hook_function($name,$parm=NULL) { global $squirrelmail_plugin_hooks, $currentHookName; -// $ret = ''; - $ret = array(); + $ret = ''; $currentHookName = $name; if (isset($squirrelmail_plugin_hooks[$name]) @@ -150,8 +149,10 @@ function concat_hook_function($name,$parm=NULL) { foreach ($squirrelmail_plugin_hooks[$name] as $function) { /* Add something to set correct gettext domain for plugin. */ if (function_exists($function)) { -// $ret .= $function($parm); - $ret = sqm_array_merge($ret, $function($parm)); + $plugin_ret = $function($parm); + if (!empty($plugin_ret)) { + $ret = sqm_array_merge($ret, $plugin_ret); + } } } } @@ -160,10 +161,6 @@ function concat_hook_function($name,$parm=NULL) { /* Variable-length argument lists have a slight problem when */ /* passing values by reference. Pity. This is a workaround. */ - // FIXME: empty return array breaks legacy use of this hook, so - // as a workaround, return empty string (let's fix the - // hook calls so we can pull this out) - if (empty($ret)) return ''; return $ret; }