diff options
author | Yasuhito FUTATSUKI at POEM <futatuki@poem.co.jp> | 2016-07-17 06:39:50 +0900 |
---|---|---|
committer | Yasuhito FUTATSUKI at POEM <futatuki@poem.co.jp> | 2016-07-17 06:39:50 +0900 |
commit | 8a31986e68316d0a06919990abad096ee6c0e041 (patch) | |
tree | 3d198ba9f0e4e17eaa242c3a4587ee6ec1ae852f /Mailman/Cgi/roster.py | |
parent | 8cac32e5bac4495139573b07da94c255522e8498 (diff) | |
parent | b17234a23a590d9b27f3f609781596eea27b6974 (diff) | |
download | mailman2-8a31986e68316d0a06919990abad096ee6c0e041.tar.gz mailman2-8a31986e68316d0a06919990abad096ee6c0e041.tar.xz mailman2-8a31986e68316d0a06919990abad096ee6c0e041.zip |
Merge lp:mailman/2.1 up to rev 1664
Diffstat (limited to 'Mailman/Cgi/roster.py')
-rw-r--r-- | Mailman/Cgi/roster.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/Mailman/Cgi/roster.py b/Mailman/Cgi/roster.py index 6c64925b..e9ab03c1 100644 --- a/Mailman/Cgi/roster.py +++ b/Mailman/Cgi/roster.py @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2014 by the Free Software Foundation, Inc. +# Copyright (C) 1998-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 @@ -63,7 +63,19 @@ def main(): cgidata = cgi.FieldStorage() # messages in form should go in selected language (if any...) - lang = cgidata.getvalue('language') + try: + lang = cgidata.getvalue('language') + except TypeError: + # Someone crafted a POST with a bad Content-Type:. + doc = Document() + doc.set_language(mm_cfg.DEFAULT_SERVER_LANGUAGE) + 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 + if not Utils.IsLanguage(lang): lang = mlist.preferred_language i18n.set_language(lang) |