summaryrefslogtreecommitdiff
path: root/program/lib/Roundcube
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2015-01-29 12:41:43 -0500
committerAleksander Machniak <alec@alec.pl>2015-01-29 12:41:43 -0500
commit0a5841702fdc6e71f23b7eebd046ef715b74b544 (patch)
tree2e39bdf09ca0a65da71493a982ab2a26d86b15a0 /program/lib/Roundcube
parent758e7c47e90292e54cc59d9ad718325905857cd2 (diff)
Fix exec_hook() so handlers added inside the hook are not omitted
Diffstat (limited to 'program/lib/Roundcube')
-rw-r--r--program/lib/Roundcube/rcube_plugin_api.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/program/lib/Roundcube/rcube_plugin_api.php b/program/lib/Roundcube/rcube_plugin_api.php
index 346e832fb..b3a32985c 100644
--- a/program/lib/Roundcube/rcube_plugin_api.php
+++ b/program/lib/Roundcube/rcube_plugin_api.php
@@ -400,8 +400,9 @@ class rcube_plugin_api
$args += array('abort' => false);
array_push($this->exec_stack, $hook);
- foreach ((array)$this->handlers[$hook] as $callback) {
- $ret = call_user_func($callback, $args);
+ // Use for loop here, so handlers added in the hook will be executed too
+ for ($i = 0; $i < count($this->handlers[$hook]); $i++) {
+ $ret = call_user_func($this->handlers[$hook][$i], $args);
if ($ret && is_array($ret)) {
$args = $ret + $args;
}