X-Git-Url: https://git.donarmstrong.com/?p=debbugs.git;a=blobdiff_plain;f=Debbugs%2FCGI%2FBugreport.pm;h=95201d23a20b2c122c5b46218179f0c4c4bd42ca;hp=c1d0aaf13558447695c7250ae22b14c37798db22;hb=539af97afc41be51d7f9d70a7d1e94c0ed0516cc;hpb=ef74deb399d89171922274272896cfd40f77bc61 diff --git a/Debbugs/CGI/Bugreport.pm b/Debbugs/CGI/Bugreport.pm index c1d0aaf..95201d2 100644 --- a/Debbugs/CGI/Bugreport.pm +++ b/Debbugs/CGI/Bugreport.pm @@ -27,6 +27,7 @@ None known. use warnings; use strict; +use utf8; use vars qw($VERSION $DEBUG %EXPORT_TAGS @EXPORT_OK @EXPORT); use Exporter qw(import); @@ -44,6 +45,7 @@ use POSIX qw(strftime); use Encode qw(decode_utf8 encode_utf8); use URI::Escape qw(uri_escape_utf8); use Scalar::Util qw(blessed); +use List::AllUtils qw(sum); use File::Temp; BEGIN{ @@ -277,7 +279,7 @@ sub display_entity { # if the first 20 lines in the message which have any non-space # characters are larger than 100 characters more often than they # are not, then use CSS to try to impose sensible wrapping - sum0(map {length ($_) > 100?1:-1} grep {/\S/} split /\n/,$body,20) > 0 + sum(0,map {length ($_) > 100?1:-1} grep {/\S/} split /\n/,$body,20) > 0 ) { $css_class .= " wrapping"; } @@ -302,7 +304,7 @@ sub display_entity { ) { # Add links to CVE vulnerabilities (closes #568464) $body =~ s{(^|\s|[\(\[])(CVE-\d{4}-\d{4,})(\s|[,.-\[\]\)]|$)} - {$1$2$3}gxm; + {$1$2$3}gxm; } if (not exists $param{att}) { print {$output} qq(
$body
\n); @@ -414,19 +416,20 @@ sub handle_record{ if (defined $time) { $output .= ' ('.strftime('%a, %d %b %Y %T GMT',gmtime($time)).') '; } - $output .= ' $bug_number, options => {msg => ($msg_number+1)}, links_only => 1, ) - ) . '">Full text and full text, rfc822 format available.'; + ) . '">mbox, '. + qq{link).

}; - $output = qq(

\n\n) . $output . "
\n"; + $output = qq(

\n\n) . $output . "

\n"; } elsif (/recips/) { my ($msg_id) = record_regex($record,qr/^Message-Id:\s+<(.+)>/i); @@ -437,7 +440,7 @@ sub handle_record{ $$seen_msg_ids{$msg_id} = 1; } return () if defined $param{spam} and $param{spam}->is_spam($msg_id); - $output .= qq(

\n); + $output .= qq(


🔗\n); $output .= 'View this message in rfc822 format

'; $output .= handle_email_message($record, ref => $bug_number, @@ -473,6 +476,7 @@ sub handle_record{ # this will be cleaned up once it goes out of scope my $tempdir = File::Temp->newdir(); $parser->output_under($tempdir->dirname()); + $parser->filer->ignore_filename(1); my $entity; if ($record->{inner_file}) { $entity = $parser->parse($record->{fh});