]> git.donarmstrong.com Git - debbugs.git/blobdiff - cgi/bugreport.cgi
* Handle multiple packages in Debbugs::Packages::get_versions (arrayref)
[debbugs.git] / cgi / bugreport.cgi
index 4987816f8732101885b915cf9f6d303a12ffed42..64547d40a1eceaeb51daa521002b93113c3f1223 100755 (executable)
@@ -11,7 +11,7 @@ use IO::File;
 use Debbugs::Config qw(:globals :text);
 
 # for read_log_records
-use Debbugs::Log;
+use Debbugs::Log qw(read_log_records);
 use Debbugs::MIME qw(convert_to_utf8 decode_rfc1522 create_mime_message);
 use Debbugs::CGI qw(:url :html :util);
 use Debbugs::Common qw(buglog getmaintainers);
@@ -176,6 +176,12 @@ sub display_entity ($$$$\$\@) {
              my $body = $entity->bodyhandle->as_string;
              $body = convert_to_utf8($body,$charset) if defined $charset;
              $body = html_escape($body);
+             # Attempt to deal with format=flowed
+             if ($content_type =~ m/format\s*=\s*\"?flowed\"?/i) {
+                  $body =~ s{^\ }{}mgo;
+                  # we ignore the other things that you can do with
+                  # flowed e-mails cause they don't really matter.
+             }
              # Add links to URLs
              $body =~ s,((ftp|http|https)://[\S~-]+?/?)((\&gt\;)?[)]?[']?[:.\,]?(\s|$)),<a href=\"$1\">$1</a>$3,go;
              # Add links to bug closures
@@ -431,7 +437,7 @@ sub handle_record{
                      {(defined $2?$1.bug_links($2):'').$3.
                            join(' ',map {bug_links($_)} (split /\,?\s+/, $4))}eo;
          # Add links to reassigned packages
-         $output =~ s{(Bug reassigned from package \`)([^\']+)(' to \`)([^\']+)(')}
+         $output =~ s{(Bug reassigned from package \`)([^']+)((?:'|\&\#39;) to \`)([^']+)((?:'|\&\#39;))}
          {$1.q(<a href=").pkg_url(pkg=>$2).qq(">$2</a>).$3.q(<a href=").pkg_url(pkg=>$4).qq(">$4</a>).$5}eo;
          if (defined $time) {
               $output .= ' ('.strftime('%a, %d %b %Y %T GMT',gmtime($time)).') ';