[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#566068: debbugs: Debbugs::MIME::parse doesn't support "text" Content-Type

Package: debbugs
Severity: normal
Tags: patch

A few bugs, such as #145541 or $70041 have a report with Content-Type: text.

Like with #565981, it may have an impact on the indexing of such bugs.

The attached patch should fix the problem.

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.31-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
--- /org/bugs.debian.org/perl/Debbugs/MIME.pm	2010-01-06 07:54:36.000000000 +0000
+++ /home/glandium/Debbugs/MIME.pm	2010-01-20 22:14:55.000000000 +0000
@@ -57,7 +57,7 @@
     my $entity = shift;
     my $type = $entity->effective_type;
-    if ($type eq 'text/plain' or
+    if ($type eq 'text/plain' or $type eq 'text' or
 	    ($type =~ m#text/# and $type ne 'text/html') or
 	    $type eq 'application/pgp') {
 	return $entity->bodyhandle;
@@ -120,7 +120,7 @@
     # Strip off RFC2440-style PGP clearsigning.
     if (@bodylines and $bodylines[0] =~ /^-----BEGIN PGP SIGNED/) {
-	shift @bodylines while @bodylines and length $bodylines[0];
+	shift @bodylines while @bodylines and $bodylines[0] =~ /\S/;
 	shift @bodylines while @bodylines and $bodylines[0] !~ /\S/;
 	for my $findsig (0 .. $#bodylines) {
 	    if ($bodylines[$findsig] =~ /^-----BEGIN PGP SIGNATURE/) {

Reply to: