From: don <> Date: Thu, 4 Aug 2005 11:22:29 +0000 (-0800) Subject: [project @ 2005-08-04 04:22:29 by don] X-Git-Tag: release/2.6.0~664 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=8f3bc1897db7bb7873cfa5e3340e4e9faa79e3d1;p=debbugs.git [project @ 2005-08-04 04:22:29 by don] * Wrap the read_log_records call in eval so we output a useful error message using quitcgi on munged bugs * Really output boring records if we're only outputing one record * Add the appropriate meta http-equiv tag to indicate that we're sending utf-8 so things that save the pages display in an appropriate charset --- diff --git a/cgi/bugreport.cgi b/cgi/bugreport.cgi index d9c95457..a07fc0d4 100755 --- a/cgi/bugreport.cgi +++ b/cgi/bugreport.cgi @@ -289,7 +289,13 @@ if ($buglog !~ m#^\Q$gSpoolDir/db#) { } -my @records = read_log_records($buglogfh); +my @records; +eval{ + @records = read_log_records($buglogfh); +}; +if ($@) { + quitcgi("Bad bug log for $debbugs::gBug $ref. Unable to read records: $@"); +} undef $buglogfh; =head2 handle_email_message @@ -428,12 +434,13 @@ if ( $mbox ) { print "Content-Type: text/plain\n\n"; } else { + $msg_num++; print qq(Content-Disposition: attachment; filename="bug_${ref}_message_${msg_num}.mbox"\n); print "Content-Type: message/rfc822\n\n"; } for my $record (@records) { next if $record->{type} !~ /^(?:recips|incoming-recv)$/; - next if not $boring and $record->{type} eq 'recips'; + next if not $boring and $record->{type} eq 'recips' and @records > 1; my @lines = split( "\n", $record->{text}, -1 ); if ( $lines[ 1 ] =~ m/^From / ) { my $tmp = $lines[ 0 ]; @@ -474,6 +481,7 @@ my $title = htmlsanit($status{subject}); print "\n"; print "\n" . "$debbugs::gProject $debbugs::gBug report logs - $short - $title\n" . + ''. # "" . "\n" . '' .