diff options
| author | jhylton | 2000-09-22 16:28:01 +0000 |
|---|---|---|
| committer | jhylton | 2000-09-22 16:28:01 +0000 |
| commit | 61afff29ca6bac5febcbf680ecaf5b37b59f3010 (patch) | |
| tree | 8337ef67e20cd272db85691ac624c5bee528d361 /Mailman/Archiver/HyperArch.py | |
| parent | d7190ce7369d79b97f17c0ba9c85bbb782f87554 (diff) | |
| download | mailman-61afff29ca6bac5febcbf680ecaf5b37b59f3010.tar.gz mailman-61afff29ca6bac5febcbf680ecaf5b37b59f3010.tar.zst mailman-61afff29ca6bac5febcbf680ecaf5b37b59f3010.zip | |
replace null bytes in message body with spaces
Diffstat (limited to 'Mailman/Archiver/HyperArch.py')
| -rw-r--r-- | Mailman/Archiver/HyperArch.py | 6 |
1 files 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""" |
