diff options
author | zotlabs <mike@macgirvin.com> | 2018-09-20 18:36:14 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2018-09-20 18:36:14 -0700 |
commit | a4d987b45a841acaf9b825ecf466072b09a8c254 (patch) | |
tree | 15d281573f28c0f62b48b3e1355add4ff2178d26 /include/plugin.php | |
parent | 3cc66b68162a82493cd68d369e4f0cbb01f941d0 (diff) | |
parent | 369f34b2d122c7bd22522101fc9e4ce0f597a04e (diff) | |
download | volse-hubzilla-a4d987b45a841acaf9b825ecf466072b09a8c254.tar.gz volse-hubzilla-a4d987b45a841acaf9b825ecf466072b09a8c254.tar.bz2 volse-hubzilla-a4d987b45a841acaf9b825ecf466072b09a8c254.zip |
Merge branch 'dev'
Diffstat (limited to 'include/plugin.php')
-rwxr-xr-x | include/plugin.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/plugin.php b/include/plugin.php index 9757be356..fdc62b3a7 100755 --- a/include/plugin.php +++ b/include/plugin.php @@ -458,6 +458,25 @@ function call_hooks($name, &$data = null) { if (isset(App::$hooks[$name])) { foreach(App::$hooks[$name] as $hook) { + + if ($name != 'permit_hook') { // avoid looping + $checkhook = [ + 'name'=>$name, + 'hook'=>$hook, + 'data'=>$data, + // Note: Since PHP uses COPY-ON-WRITE + // for variables, there is no cost to + // passing the $data structure (unless + // the permit_hook processors change the + // information it contains. + 'permit'=>true + ]; + call_hooks('permit_hook',$checkhook); + if (!$checkhook['permit']) { + continue; + } + $data = $checkhook['data']; + } $origfn = $hook[1]; if($hook[0]) @include_once($hook[0]); |