From 61afff29ca6bac5febcbf680ecaf5b37b59f3010 Mon Sep 17 00:00:00 2001 From: jhylton Date: Fri, 22 Sep 2000 16:28:01 +0000 Subject: replace null bytes in message body with spaces --- Mailman/Archiver/HyperArch.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Mailman/Archiver/HyperArch.py b/Mailman/Archiver/HyperArch.py index aadfe3f0a..8f855ce55 100644 --- a/Mailman/Archiver/HyperArch.py +++ b/Mailman/Archiver/HyperArch.py @@ -68,6 +68,8 @@ def html_quote(s): def url_quote(s): return urllib.quote(s) +def null_to_space(s): + return string.replace(s, '\000', ' ') article_text_template="""\ From %(email)s %(fromdate)s @@ -312,7 +314,7 @@ class Article(pipermail.Article): def _get_body(self): """Return the message body ready for HTML, decoded if necessary""" if self.charset is None or self.cenc != "quoted-printable": - return string.join(self.body, "") + return null_to_space(string.join(self.body, "")) # the charset is specified and the body is quoted-printable # first get rid of soft line breaks, then decode literals lines = [] @@ -337,7 +339,7 @@ class Article(pipermail.Article): chunks.append(buf[offset:i]) offset = i + 3 chunks.append(chr(string.atoi(mo.group(1), 16))) - return string.join(chunks, "") + return null_to_space(string.join(chunks, "")) def _add_decoded(self, d): """Add encoded-word keys to HTML output""" -- cgit v1.2.3-70-g09d2