aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2018-09-20 12:10:39 +0200
committerMario Vavti <mario@mariovavti.com>2018-09-20 12:10:39 +0200
commita6db822a696afe808d9c8cb34af1075a42fffada (patch)
tree6692324758d22afa7d0588a8262d53eabde99ee7 /include
parentad8226d549f40a1ae1ea47a83778afffb9230042 (diff)
parent1b2732705782a6369bdff0c00b650dfc5c1353a9 (diff)
downloadvolse-hubzilla-a6db822a696afe808d9c8cb34af1075a42fffada.tar.gz
volse-hubzilla-a6db822a696afe808d9c8cb34af1075a42fffada.tar.bz2
volse-hubzilla-a6db822a696afe808d9c8cb34af1075a42fffada.zip
Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
Diffstat (limited to 'include')
-rwxr-xr-xinclude/plugin.php19
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]);