diff options
author | lpsolit%gmail.com <> | 2009-07-19 12:03:35 +0000 |
---|---|---|
committer | lpsolit%gmail.com <> | 2009-07-19 12:03:35 +0000 |
commit | 2c31d0cf347f468696918da646e1d8c92a850e19 (patch) | |
tree | 4966e8f44d98eacf30ac9727996cccb8a136a068 | |
parent | Bug 323606: sanitycheck.cgi should offer a link to fix everconfirmed - Patch ... (diff) | |
download | bugzilla-2c31d0cf347f468696918da646e1d8c92a850e19.tar.gz bugzilla-2c31d0cf347f468696918da646e1d8c92a850e19.tar.bz2 bugzilla-2c31d0cf347f468696918da646e1d8c92a850e19.zip |
Bug 503821: Link in "Delete Tag?" user error triggers "Suspicious action" prompt - Patch by Frédéric Buclin <LpSolit@gmail.com> r=wicked a=LpSolit
-rwxr-xr-x | buglist.cgi | 12 | ||||
-rw-r--r-- | template/en/default/global/user-error.html.tmpl | 6 |
2 files changed, 12 insertions, 6 deletions
diff --git a/buglist.cgi b/buglist.cgi index a48775901..294b8d153 100755 --- a/buglist.cgi +++ b/buglist.cgi @@ -566,7 +566,10 @@ elsif (($cgi->param('cmdtype') eq "doit") && defined $cgi->param('remtype')) { # exists, add/remove bugs to it, else create it. But if we are # considering an existing tag, then it has to exist and we throw # an error if it doesn't (hence the usage of !$is_new_name). - if (my $old_query = LookupNamedQuery($query_name, undef, LIST_OF_BUGS, !$is_new_name)) { + my ($old_query, $query_id) = + LookupNamedQuery($query_name, undef, LIST_OF_BUGS, !$is_new_name); + + if ($old_query) { # We get the encoded query. We need to decode it. my $old_cgi = new Bugzilla::CGI($old_query); foreach my $bug_id (split /[\s,]+/, scalar $old_cgi->param('bug_id')) { @@ -590,9 +593,10 @@ elsif (($cgi->param('cmdtype') eq "doit") && defined $cgi->param('remtype')) { # Only keep bug IDs we want to add/keep. Disregard deleted ones. my @bug_ids = grep { $bug_ids{$_} == 1 } keys %bug_ids; # If the list is now empty, we could as well delete it completely. - ThrowUserError('no_bugs_in_list', {'tag' => $query_name}) - unless scalar(@bug_ids); - + if (!scalar @bug_ids) { + ThrowUserError('no_bugs_in_list', {name => $query_name, + query_id => $query_id}); + } $new_query = "bug_id=" . join(',', sort {$a <=> $b} @bug_ids); $query_type = LIST_OF_BUGS; } diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index bbae9b39c..1c834d47a 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -1101,9 +1101,11 @@ [% ELSIF error == "no_bugs_in_list" %] [% title = "Delete Tag?" %] This will remove all [% terms.bugs %] from the - [% tag FILTER html %] tag. This will delete the tag completely. Click + <em>[% name FILTER html %]</em> tag. This will delete the tag completely. Click <a href="buglist.cgi?cmdtype=dorem&remaction=forget&namedcmd= - [%- tag FILTER url_quote %]">here</a> if you really want to delete it. + [%- name FILTER url_quote %]&token= + [%- issue_hash_token([query_id, name]) FILTER url_quote %]">here</a> + if you really want to delete it. [% ELSIF error == "no_bugs_to_remove" %] [% title = "No Tag Selected" %] |