Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
This commit is contained in:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user