]> git.donarmstrong.com Git - debbugs.git/blobdiff - Debbugs/Control.pm
pass uri_escape to templates in bugreport.cgi
[debbugs.git] / Debbugs / Control.pm
index 6f7420679beadd8339de6574877ec0758937d55e..ab6038426da841bd8bd20f0db31728d9a4f75b9b 100644 (file)
@@ -134,7 +134,7 @@ use Mail::RFC822::Address qw();
 use POSIX qw(strftime);
 
 use Storable qw(dclone nfreeze);
-use List::Util qw(first max);
+use List::AllUtils qw(first max);
 use Encode qw(encode_utf8);
 
 use Carp;
@@ -1975,8 +1975,11 @@ sub set_merged {
                $data->{mergedwith} = '';
            }
            else {
-               $data->{mergedwith} = join(' ',sort grep {$_ != $data->{bug_num}}
-                                           keys %merged_bugs);
+               $data->{mergedwith} =
+                   join(' ',
+                        sort {$a <=> $b}
+                        grep {$_ != $data->{bug_num}}
+                        keys %merged_bugs);
            }
            append_action_to_log(bug => $data->{bug_num},
                                 command  => 'merge',
@@ -2157,11 +2160,14 @@ sub set_merged {
     }
 
     # finally, we can merge the bugs
-    my $action = "Merged ".join(' ',sort keys %merged_bugs);
+    my $action = "Merged ".join(' ',sort { $a <=> $b } keys %merged_bugs);
     for my $data (@data) {
        my $old_data = dclone($data);
-       $data->{mergedwith} = join(' ',sort grep {$_ != $data->{bug_num}}
-                                   keys %merged_bugs);
+       $data->{mergedwith} =
+           join(' ',
+                sort { $a <=> $b }
+                grep {$_ != $data->{bug_num}}
+                keys %merged_bugs);
        append_action_to_log(bug => $data->{bug_num},
                             command  => 'merge',
                             new_data => $data,
@@ -2936,7 +2942,8 @@ sub clone_bug {
     for my $bug (split ' ', $data->{blocks}) {
        for my $new_bug (@new_bugs) {
            set_blocks(bug => $bug,
-                   block => $new_bug,
+                      block => $new_bug,
+                      add => 1,
                       hash_slice(%param,
                                  keys %common_options,
                                  keys %append_action_options),
@@ -2947,7 +2954,8 @@ sub clone_bug {
     for my $bug (split ' ', $data->{blockedby}) {
        for my $new_bug (@new_bugs) {
            set_blocks(bug => $new_bug,
-                   block => $bug,
+                      block => $bug,
+                      add => 1,
                       hash_slice(%param,
                                  keys %common_options,
                                  keys %append_action_options),
@@ -3790,7 +3798,7 @@ LIMIT:        for my $limit (make_list($param{limit}{$field})) {
            }
            if (not $match) {
                $going_to_fail = 1;
-               print {$transcript} qq($field: ).join(', ',map{qq("$_")} make_list($data->{$field})).
+               print {$transcript} qq($field: ').join(', ',map{qq("$_")} make_list($data->{$field})).
                    "' does not match at least one of ".
                    join(', ',map {ref($_)?'(regex)':qq("$_")} make_list($param{limit}{$field}))."\n";
            }
@@ -3833,7 +3841,7 @@ sub __message_body_template{
      $extra_var ||={};
      my $hole_var = {'&bugurl' =>
                     sub{"$_[0]: ".
-                            'http://'.$config{cgi_domain}.'/'.
+                            $config{cgi_domain}.'/'.
                                 Debbugs::CGI::bug_links(bug => $_[0],
                                                         links_only => 1,
                                                        );