mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-11 05:48:51 +00:00
[ticket/security/246] Check form key no matter if submit is set
SECURITY-246
This commit is contained in:
parent
9e9bdb69b5
commit
cdf4f5ef85
1 changed files with 6 additions and 6 deletions
|
@ -33,7 +33,6 @@ class acp_bbcodes
|
||||||
// Set up general vars
|
// Set up general vars
|
||||||
$action = $request->variable('action', '');
|
$action = $request->variable('action', '');
|
||||||
$bbcode_id = $request->variable('bbcode', 0);
|
$bbcode_id = $request->variable('bbcode', 0);
|
||||||
$submit = $request->is_set_post('submit');
|
|
||||||
|
|
||||||
$this->tpl_name = 'acp_bbcodes';
|
$this->tpl_name = 'acp_bbcodes';
|
||||||
$this->page_title = 'ACP_BBCODES';
|
$this->page_title = 'ACP_BBCODES';
|
||||||
|
@ -41,11 +40,6 @@ class acp_bbcodes
|
||||||
|
|
||||||
add_form_key($form_key);
|
add_form_key($form_key);
|
||||||
|
|
||||||
if ($submit && !check_form_key($form_key))
|
|
||||||
{
|
|
||||||
trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set up mode-specific vars
|
// Set up mode-specific vars
|
||||||
switch ($action)
|
switch ($action)
|
||||||
{
|
{
|
||||||
|
@ -179,6 +173,12 @@ class acp_bbcodes
|
||||||
extract($phpbb_dispatcher->trigger_event('core.acp_bbcodes_modify_create', compact($vars)));
|
extract($phpbb_dispatcher->trigger_event('core.acp_bbcodes_modify_create', compact($vars)));
|
||||||
|
|
||||||
$warn_text = preg_match('%<[^>]*\{text[\d]*\}[^>]*>%i', $bbcode_tpl);
|
$warn_text = preg_match('%<[^>]*\{text[\d]*\}[^>]*>%i', $bbcode_tpl);
|
||||||
|
|
||||||
|
if (!$warn_text && !check_form_key($form_key))
|
||||||
|
{
|
||||||
|
trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||||
|
}
|
||||||
|
|
||||||
if (!$warn_text || confirm_box(true))
|
if (!$warn_text || confirm_box(true))
|
||||||
{
|
{
|
||||||
$data = $this->build_regexp($bbcode_match, $bbcode_tpl);
|
$data = $this->build_regexp($bbcode_match, $bbcode_tpl);
|
||||||
|
|
Loading…
Add table
Reference in a new issue