changeset 1616:d1c37c39f8ad

mailimport: replace / in subject by \ because it is invalid in (sub)page names
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 09 Oct 2006 18:36:20 +0200
parents 9fa2ec252d1f
children 1c28e0ea4fd0 e682a1ea7a68
files MoinMoin/mail/mailimport.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/mail/mailimport.py	Mon Oct 09 18:12:13 2006 +0200
+++ b/MoinMoin/mail/mailimport.py	Mon Oct 09 18:36:20 2006 +0200
@@ -164,10 +164,12 @@
     if pagename_tpl.endswith("/"):
         pagename_tpl += email_subpage_template
 
+    subject = msg['subject'].replace('/', '\\') # we can't use / in pagenames
+
     # rewrite using string.formatter when python 2.4 is mandatory
     pagename = (pagename_tpl.replace("$from", msg['from_addr'][0]).
                 replace("$date", msg['date']).
-                replace("$subject", msg['subject']))
+                replace("$subject", subject))
 
     if pagename.startswith("+ ") and "/" in pagename:
         generate_summary = True