diff options
Diffstat (limited to 'Mailman/Cgi/create.py')
-rw-r--r-- | Mailman/Cgi/create.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/Mailman/Cgi/create.py b/Mailman/Cgi/create.py index cac5a2e7..3c2a7dc4 100644 --- a/Mailman/Cgi/create.py +++ b/Mailman/Cgi/create.py @@ -1,4 +1,4 @@ -# Copyright (C) 2001-2010 by the Free Software Foundation, Inc. +# Copyright (C) 2001-2016 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -43,6 +43,17 @@ def main(): doc.set_language(mm_cfg.DEFAULT_SERVER_LANGUAGE) cgidata = cgi.FieldStorage() + try: + cgidata.getvalue('doit', '') + except TypeError: + # Someone crafted a POST with a bad Content-Type:. + doc.AddItem(Header(2, _("Error"))) + doc.AddItem(Bold(_('Invalid options to CGI script.'))) + # Send this with a 400 status. + print 'Status: 400 Bad Request' + print doc.Format() + return + parts = Utils.GetPathPieces() if parts: # Bad URL specification @@ -250,9 +261,10 @@ def process_request(doc, cgidata): 'requestaddr' : mlist.GetRequestEmail(), 'siteowner' : siteowner, }, mlist=mlist) - msg = Message.OwnerNotification(mlist, + msg = Message.UserNotification( + owner, siteowner, _('Your new mailing list: %(listname)s'), - text=text, tomoderators=0) + text, mlist.preferred_language) msg.send(mlist) # Success! |