summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbwarsaw1999-03-31 17:52:42 +0000
committerbwarsaw1999-03-31 17:52:42 +0000
commit6e1072fdc0cf64074a770eb9734bf1f138fc359d (patch)
tree5415dd80c28b476ce15cac28f8a274d772a81fd7
parent8a4807b3c699ec21452516258af36fdec39de411 (diff)
downloadmailman-6e1072fdc0cf64074a770eb9734bf1f138fc359d.tar.gz
mailman-6e1072fdc0cf64074a770eb9734bf1f138fc359d.tar.zst
mailman-6e1072fdc0cf64074a770eb9734bf1f138fc359d.zip
HandlePostRequest(): Need to "strquote" (e.g. replace % with %%) in
string read from Web text box.
-rw-r--r--Mailman/ListAdmin.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/Mailman/ListAdmin.py b/Mailman/ListAdmin.py
index aea0f7dba..090bb6ce8 100644
--- a/Mailman/ListAdmin.py
+++ b/Mailman/ListAdmin.py
@@ -148,14 +148,20 @@ class ListAdmin:
# Discard.
rejection = "Discarded"
if rejection:
- note = "%s: %s posting:" % (self._internal_name, rejection)
- note = note + "\n\tFrom: %s" % msg.GetSender()
- note = note + ("\n\tSubject: %s"
- % (msg.getheader('subject') or '<none>'))
+ note = '''%(listname)s: %(rejection)s posting:
+\tFrom: %(sender)s
+\tSubject: %(subject)s''' % {'listname' : self._internal_name,
+ 'rejection': rejection,
+ 'sender' : msg.GetSender(),
+ 'subject' : msg.getheader('subject', '<none>'),
+ }
+ def strquote(s):
+ return string.replace(s, '%', '%%')
+
if data[1]:
- note = note + "\n\tHeld: %s" % data[1]
+ note = note + '\n\tHeld: ' + strquote(data[1])
if comment:
- note = note + "\n\tDiscarded: %s" % comment
+ note = note + '\n\tDiscarded: ' + strquote(comment)
self.LogMsg("vette", note)
def HandleAddMemberRequest(self, data, value, comment):