]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 503821: Link in "Delete Tag?" user error triggers "Suspicious action" prompt...
authorlpsolit%gmail.com <>
Sun, 19 Jul 2009 12:03:35 +0000 (12:03 +0000)
committerlpsolit%gmail.com <>
Sun, 19 Jul 2009 12:03:35 +0000 (12:03 +0000)
buglist.cgi
template/en/default/global/user-error.html.tmpl

index a487759015c106888affa8fdb5dadebd64c046af..294b8d1535cc29f17cadb16a90570b25406980a5 100755 (executable)
@@ -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;
         }
index bbae9b39cda168e3d936531ed90643c0fc4f444e..1c834d47af1d8b93105a5e4ba2f104b0f0750304 100644 (file)
   [% 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&amp;remaction=forget&amp;namedcmd=
-    [%- tag FILTER url_quote %]">here</a> if you really want to delete it.
+    [%- name FILTER url_quote %]&amp;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" %]