diff options
| author | rxu <rxu@mail.ru> | 2014-08-09 19:51:57 +0800 |
|---|---|---|
| committer | rxu <rxu@mail.ru> | 2014-08-11 02:15:05 +0800 |
| commit | b20af9a6d2ae7b05fc9912af84b0a6f955cf4556 (patch) | |
| tree | b1afd128e28ae4b21e42933ed10e2e38df645289 /phpBB/includes/functions.php | |
| parent | 20b8ea947c656382871831ee83acd5de8fcd5040 (diff) | |
| download | forums-b20af9a6d2ae7b05fc9912af84b0a6f955cf4556.tar forums-b20af9a6d2ae7b05fc9912af84b0a6f955cf4556.tar.gz forums-b20af9a6d2ae7b05fc9912af84b0a6f955cf4556.tar.bz2 forums-b20af9a6d2ae7b05fc9912af84b0a6f955cf4556.tar.xz forums-b20af9a6d2ae7b05fc9912af84b0a6f955cf4556.zip | |
[ticket/12942] Add core.add_form_key core event
Add core.add_form_key core event to allow extensions modifying
form key.
PHPBB3-12942
Diffstat (limited to 'phpBB/includes/functions.php')
| -rw-r--r-- | phpBB/includes/functions.php | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 4318b20b97..9b5a11c6fd 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2540,7 +2540,7 @@ function check_link_hash($token, $link_name) */ function add_form_key($form_name) { - global $config, $template, $user; + global $config, $template, $user, $phpbb_dispatcher; $now = time(); $token_sid = ($user->data['user_id'] == ANONYMOUS && !empty($config['form_token_sid_guests'])) ? $user->session_id : ''; @@ -2551,6 +2551,27 @@ function add_form_key($form_name) 'form_token' => $token, )); + /** + * Perform additional actions on creation of the form token + * + * @event core.add_form_key + * @var string form_name The form name + * @var int now Current time timestamp + * @var string s_fields Generated hidden fields + * @var string token Form token + * @var string token_sid User session ID + * + * @since 3.1.0-RC3 + */ + $vars = array( + 'form_name', + 'now', + 's_fields', + 'token', + 'token_sid', + ); + extract($phpbb_dispatcher->trigger_event('core.add_form_key', compact($vars))); + $template->assign_vars(array( 'S_FORM_TOKEN' => $s_fields, )); |
