Add structure to permit_hook
This commit is contained in:
parent
456fe71ca9
commit
3ee632514c
@ -463,12 +463,19 @@ function call_hooks($name, &$data = null) {
|
|||||||
$checkhook = [
|
$checkhook = [
|
||||||
'name'=>$name,
|
'name'=>$name,
|
||||||
'hook'=>$hook,
|
'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
|
'permit'=>true
|
||||||
];
|
];
|
||||||
call_hooks('permit_hook',$checkhook);
|
call_hooks('permit_hook',$checkhook);
|
||||||
if (!$checkhook['permit']) {
|
if (!$checkhook['permit']) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
$data = $checkhook['data'];
|
||||||
}
|
}
|
||||||
$origfn = $hook[1];
|
$origfn = $hook[1];
|
||||||
if($hook[0])
|
if($hook[0])
|
||||||
|
Reference in New Issue
Block a user