On Fri, 31 Dec 2004, Don Armstrong wrote:
> The attached patch fixed this particular issue.

And the one attached now fixes the other half, which I had forgotten,
namely the pkgreport.cgi.
 
See both http://bugs.donarmstrong.com/cgi/bugreport.cgi?bug=20 and 
http://bugs.donarmstrong.com/cgi/pkgreport.cgi?src=test [1]


Don Armstrong

1: No, bug 19 really isn't a bug...
-- 
I shall require that [a scientific system's] logical form shall be
such that it can be singled out, by means of emperical tests, in a
negative sense: it must be possible for an emperical scientific system
to be refuted by experience.
 -- Sir Karl Popper _Logic of Scientific Discovery_ �6

http://www.donarmstrong.com              http://rzlab.ucr.edu
? patch_for_61342.diff
Index: bugreport.cgi
===================================================================
RCS file: /cvs/debbugs/source/cgi/bugreport.cgi,v
retrieving revision 1.65
diff -u -r1.65 bugreport.cgi
--- bugreport.cgi       1 Jun 2004 00:41:26 -0000       1.65
+++ bugreport.cgi       31 Dec 2004 12:43:37 -0000
@@ -181,7 +181,7 @@
 $indexentry .= htmlpackagelinks($status{package}, 0);
 
 $indexentry .= "Reported by: <a href=\"" . submitterurl($status{originator})
-              . "\">" . htmlsanit($status{originator}) . "</a>;\n";
+              . "\">" . htmlsanit(de_rfc1522($status{originator})) . "</a>;\n";
 
 $indexentry .= "Owned by: " . htmlsanit($status{owner}) . ";\n"
               if length $status{owner};
@@ -369,7 +369,9 @@
                $normstate= 'go';
                push @mail, $_;
        } elsif ($normstate eq 'html') {
-               $this .= $_;
+               # XXX This is broken. The BTS shouldn't be writing
+               # HTML into the log... but it does.
+               $this .= de_rfc1522($_);
        } elsif ($normstate eq 'go') {
                s/^\030//;
                if (!$suppressnext && !$found_msgid &&
@@ -409,7 +411,7 @@
                        $thisheader = "<h2>Message sent:</h2>\n";
                } else {
                        s/\04/, /g; s/\n$//;
-                       $thisheader = "<h2>Message sent to 
".htmlsanit($_).":</h2>\n";
+                       $thisheader = "<h2>Message sent to 
".htmlsanit(de_rfc1522($_)).":</h2>\n";
                }
                $this = "";
                $normstate= 'kill-body';
Index: common.pl
===================================================================
RCS file: /cvs/debbugs/source/cgi/common.pl,v
retrieving revision 1.108
diff -u -r1.108 common.pl
--- common.pl   28 Mar 2004 06:02:45 -0000      1.108
+++ common.pl   31 Dec 2004 12:43:37 -0000
@@ -12,6 +12,10 @@
 
 use Debbugs::Versions;
 
+# for de_rfc1522
+use MIME::WordDecoder;
+MIME::WordDecoder->default(new MIME::WordDecoder::ISO_8859 1);
+
 $MLDBM::RemoveTaint = 1;
 
 my $common_archive = 0;
@@ -286,8 +290,8 @@
     $result .= htmlpackagelinks($status{"package"}, 1);
     $result .= $showseverity;
     $result .= "Reported by: <a href=\"" . submitterurl($status{originator})
-               . "\">" . htmlsanit($status{originator}) . "</a>";
-    $result .= ";\nOwned by: " . htmlsanit($status{owner})
+               . "\">" . htmlsanit(de_rfc1522($status{originator})) . "</a>";
+    $result .= ";\nOwned by: " . htmlsanit(de_rfc1522($status{owner}))
                if length $status{owner};
     $result .= ";\nTags: <strong>" 
                 . htmlsanit(join(", ", sort(split(/\s+/, $status{tags}))))
@@ -420,6 +424,23 @@
     $in =~ s/([<>&"])/\&$saniarray{$1};/g;
     return $in;
 }
+
+=head2 de_rfc1522
+
+     de_rfc1522('=?iso-8859-1?Q?D=F6n_Armstr=F3ng?= <[EMAIL PROTECTED]>')
+
+Turn RFC-1522 names into the ISO-8859-1 or UTF-8 equivalent. [#61342 et al]
+
+=cut
+
+sub de_rfc1522($){
+     my ($string) = @_;
+
+     # unmime calls the default MIME::WordDecoder; handler set up at
+     # initalization time.
+     return unmime($string);
+}
+
 
 sub maybelink {
     my $in = shift;

Attachment: signature.asc
Description: Digital signature

Reply via email to