X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scripts%2Fprocess;h=831099867c0dce57e5f60932c4c5b86c70500564;hb=HEAD;hp=d3e9238d2acb002e896418f0cdc0844e1d02b3f9;hpb=2c25f8427ad4939a1ee2926b8fe8a743b47fee8d;p=debbugs.git diff --git a/scripts/process b/scripts/process index d3e9238..8310998 100755 --- a/scripts/process +++ b/scripts/process @@ -30,7 +30,7 @@ use Debbugs::Text qw(:templates); use Debbugs::Config qw(:globals :config); -use Debbugs::Control qw(append_action_to_log); +use Debbugs::Control qw(append_action_to_log valid_usertag); use Debbugs::Control::Service qw(valid_control control_line); use Debbugs::Recipients qw(determine_recipients); use Encode qw(encode_utf8 decode); @@ -184,7 +184,7 @@ for my $hdr (@headerlines) { mail-followup-to| references): |From\s|X-Debbugs-)/xi; - $fwd .= encode_utf8($hdr)."\n" if $ins; + $fwd .= $orig_hdr."\n" if $ins; # print {$debugfh} ">$_<\n"; if (s/^(\S+):\s*//) { my $v = lc $1; @@ -192,7 +192,13 @@ for my $hdr (@headerlines) { push @common_headers, 'X-Loop',$_; } print {$debugfh} ">$v=$_<\n"; - $header{$v} = $_; + # Handle a comma which is escaped being passed through un-escaped. See + # https://bugs.debian.org/1041638 + if ($_ =~ m/,/ and not $orig_hdr =~ m/,/) { + $header{$v} = handle_escaped_commas($_,$orig_hdr); + } else { + $header{$v} = $_; + } } else { print {$debugfh} "!>$_<\n"; } @@ -700,7 +706,8 @@ if ($ref<0) { # new bug report $data->{msgid} = $header{'message-id'}; writebug($ref, $data); # Deal with usertags - my $current_user = $replyto; + my $current_user; + unshift @usertag_bits, ['user', $replyto]; for my $field (@usertag_bits) { my ($name, $value) = @$field; if ($name eq 'user') { @@ -717,12 +724,12 @@ if ($ref<0) { # new bug report ); } } - if ($name eq 'usertags'){ + if ($name eq 'usertags' and defined $current_user){ my %user_tags; read_usertags(\%user_tags, $current_user); $value =~ s/(?:^\s+|\s+$)//g; for my $tag (split /[,\s]+/, $value) { - if ($tag =~ /^[a-zA-Z0-9.+\@-]+/) { + if (valid_usertag($tag)) { my %bugs_with_tag; @bugs_with_tag{@{$user_tags{$tag}||[]}} = (1) x @{$user_tags{$tag}||[]}; $bugs_with_tag{$ref} = 1;