diff options
Diffstat (limited to 'editkeywords.cgi')
-rwxr-xr-x | editkeywords.cgi | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/editkeywords.cgi b/editkeywords.cgi index dbc92971d..76bba4817 100755 --- a/editkeywords.cgi +++ b/editkeywords.cgi @@ -151,26 +151,23 @@ if ($action eq 'update') { exit; } - -if ($action eq 'delete') { +if ($action eq 'del') { my $keyword = new Bugzilla::Keyword($key_id) || ThrowCodeError('invalid_keyword_id', { id => $key_id }); $vars->{'keyword'} = $keyword; + $vars->{'token'} = issue_session_token('delete_keyword'); - # We need this token even if there is no bug using this keyword. - $token = issue_session_token('delete_keyword'); - - if (!$cgi->param('reallydelete') && $keyword->bug_count) { - $vars->{'token'} = $token; + print $cgi->header(); + $template->process("admin/keywords/confirm-delete.html.tmpl", $vars) + || ThrowTemplateError($template->error()); + exit; +} - print $cgi->header(); - $template->process("admin/keywords/confirm-delete.html.tmpl", $vars) - || ThrowTemplateError($template->error()); - exit; - } - # We cannot do this check earlier as we have to check 'reallydelete' first. +if ($action eq 'delete') { check_token_data($token, 'delete_keyword'); + my $keyword = new Bugzilla::Keyword($key_id) + || ThrowCodeError('invalid_keyword_id', { id => $key_id }); $dbh->do('DELETE FROM keywords WHERE keywordid = ?', undef, $keyword->id); $dbh->do('DELETE FROM keyworddefs WHERE id = ?', undef, $keyword->id); |