Fix loss of
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 20 Mar 2007 23:17:14 +0000 (23:17 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 20 Mar 2007 23:17:14 +0000 (23:17 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12343 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/plugin.php

index 99eb79aa64fde55a813dd60315f93aad153d49ec..d586c360a05d1f0d611d30f14d06d46782a5af75 100644 (file)
@@ -81,6 +81,12 @@ function do_hook($name, &$args) {
             use_plugin($plugin_name);
             if (function_exists($function)) {
                 $ret = $function($args, $ret);
+
+                // each plugin can call additional hooks, so need
+                // to make sure the current hook name is accurate
+                // again after each plugin has finished
+                //
+                $currentHookName = $name;
             }
         }
     }
@@ -148,6 +154,12 @@ function concat_hook_function($name, &$args, $force_array=FALSE) {
                 if (!empty($plugin_ret)) {
                     $ret = sqm_array_merge($ret, $plugin_ret);
                 }
+
+                // each plugin can call additional hooks, so need
+                // to make sure the current hook name is accurate
+                // again after each plugin has finished
+                //
+                $currentHookName = $name;
             }
         }
     }
@@ -208,6 +220,12 @@ function boolean_hook_function($name, &$args, $priority=0, $tie=false) {
                 } else {
                     $nay++;
                 }
+
+                // each plugin can call additional hooks, so need
+                // to make sure the current hook name is accurate
+                // again after each plugin has finished
+                //
+                $currentHookName = $name;
             }
         }
         $currentHookName = '';