From 21eafd3e46083eded01f67ea828bc7b46ffb3f07 Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Thu, 8 Mar 2018 17:33:07 -0800 Subject: Added a few more badword checks to Utils.suspiciousHTML(). Added validation of GUI updates to host_name. --- Mailman/Gui/General.py | 10 +++++++++- Mailman/Utils.py | 31 +++++++++++++++++++++++++++---- NEWS | 5 +++++ 3 files changed, 41 insertions(+), 5 deletions(-) diff --git a/Mailman/Gui/General.py b/Mailman/Gui/General.py index 980e5f2b..dfde6309 100644 --- a/Mailman/Gui/General.py +++ b/Mailman/Gui/General.py @@ -1,4 +1,4 @@ -# Copyright (C) 2001-2014 by the Free Software Foundation, Inc. +# Copyright (C) 2001-2018 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 @@ -559,6 +559,14 @@ mlist.info. or not isinstance(val, IntType)): doc.addError(_("""admin_member_chunksize attribute not changed! It must be an integer > 0.""")) + elif property == 'host_name': + try: + Utils.ValidateEmail('user@' + val) + except Errors.EmailAddressError: + doc.addError(_("""host_name attribute not changed! + It must be a valid domain name.""")) + else: + GUIBase._setValue(self, mlist, property, val, doc) else: GUIBase._setValue(self, mlist, property, val, doc) diff --git a/Mailman/Utils.py b/Mailman/Utils.py index 9dbd0b55..fd6ac796 100644 --- a/Mailman/Utils.py +++ b/Mailman/Utils.py @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2017 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2018 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 @@ -1019,6 +1019,7 @@ _badwords = [ '