From a3f4485b329db673b679b0470c61a80fe8a717de Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 25 Mar 2019 22:03:25 +0100 Subject: [inc/Trigger] Fix Trigger::ipxe() when called multiple times If during one execution we end up in Trigger::ipxe multiple times, we wouldn't execute any hooks because of include_once. This should be OK however, so instead of changing it to include, just remember the $taskId and return it later. --- inc/trigger.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/trigger.inc.php b/inc/trigger.inc.php index cc603719..988b31c6 100644 --- a/inc/trigger.inc.php +++ b/inc/trigger.inc.php @@ -21,7 +21,7 @@ class Trigger public static function ipxe() { $hooks = Hook::load('ipxe-update'); - $taskId = false; + static $taskId = false; foreach ($hooks as $hook) { $ret = function($taskId) use ($hook) { $ret = include_once($hook->file); -- cgit v1.2.3-55-g7522