diff options
| -rw-r--r-- | phpBB/includes/acp/acp_extensions.php | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php index 5a2ded91e2..4d00279474 100644 --- a/phpBB/includes/acp/acp_extensions.php +++ b/phpBB/includes/acp/acp_extensions.php @@ -56,6 +56,18 @@ class acp_extensions $safe_time_limit = (ini_get('max_execution_time') / 2); $start_time = time(); + // Cancel action + if ($request->is_set_post('cancel')) + { + $action = 'list'; + $ext_name = ''; + } + + if (in_array($action, array('enable', 'disable', 'delete_data')) && !check_link_hash($request->variable('hash', ''), $action . '.' . $ext_name)) + { + trigger_error('FORM_INVALID', E_USER_WARNING); + } + /** * Event to run a specific action on extension * @@ -65,22 +77,22 @@ class acp_extensions * @var string ext_name Extension name from request * @var int safe_time_limit Safe limit of execution time * @var int start_time Start time + * @var string tpl_name Template file to load; leave empty to continue execution, filled in if ready to finish * @since 3.1.11-RC1 */ $u_action = $this->u_action; - $vars = array('action', 'u_action', 'ext_name', 'safe_time_limit', 'start_time'); + $tpl_name = ''; + $vars = array('action', 'u_action', 'ext_name', 'safe_time_limit', 'start_time', 'tpl_name'); extract($this->phpbb_dispatcher->trigger_event('core.acp_extensions_run_action', compact($vars))); - // Cancel action - if ($request->is_set_post('cancel')) - { - $action = 'list'; - $ext_name = ''; - } + // In case they have been updated by the event + $this->u_action = $u_action; + $this->tpl_name = $tpl_name; - if (in_array($action, array('enable', 'disable', 'delete_data')) && !check_link_hash($request->variable('hash', ''), $action . '.' . $ext_name)) + // If tpl_name was set by the prior event, we are done + if ($tpl_name) { - trigger_error('FORM_INVALID', E_USER_WARNING); + return; } // If they've specified an extension, let's load the metadata manager and validate it. |
