Add structure to permit_hook

This commit is contained in:
M.Dent (DM42.Net) 2018-09-19 22:33:25 -04:00
parent 456fe71ca9
commit 3ee632514c

View File

@ -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])