summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xquery.cgi3
-rw-r--r--template/en/default/search/knob.html.tmpl3
2 files changed, 5 insertions, 1 deletions
diff --git a/query.cgi b/query.cgi
index 47be93125..df3d9cadf 100755
--- a/query.cgi
+++ b/query.cgi
@@ -20,6 +20,7 @@ use Bugzilla::Product;
use Bugzilla::Keyword;
use Bugzilla::Field;
use Bugzilla::Install::Util qw(vers_cmp);
+use Bugzilla::Token;
###############
# Subroutines #
@@ -72,6 +73,8 @@ my $userid = $user->id;
if ($cgi->param('nukedefaultquery')) {
if ($userid) {
+ my $token = $cgi->param('token');
+ check_hash_token($token, ['nukedefaultquery']);
$dbh->do("DELETE FROM namedqueries" .
" WHERE userid = ? AND name = ?",
undef, ($userid, DEFAULT_QUERY_NAME));
diff --git a/template/en/default/search/knob.html.tmpl b/template/en/default/search/knob.html.tmpl
index 78479e7bf..723825a3c 100644
--- a/template/en/default/search/knob.html.tmpl
+++ b/template/en/default/search/knob.html.tmpl
@@ -62,7 +62,8 @@
[% IF userdefaultquery %]
<p>
- <a href="query.cgi?nukedefaultquery=1">
+ <a href="query.cgi?nukedefaultquery=1&amp;token=
+ [%- issue_hash_token(['nukedefaultquery']) FILTER uri %]">
Set my default search back to the system default</a>.
</p>
[% END %]