From 19b7fa435db9c4e311f05c274d2d49a685cf4af6 Mon Sep 17 00:00:00 2001 From: bwarsaw <> Date: Tue, 17 Feb 2004 19:21:11 +0000 Subject: handleForm(): Call out to self._escape() to make any entered data web-safe. This allows subclasses to override where necessary. The default implementaton is to call Utils.websafe(). --- Mailman/Gui/GUIBase.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Mailman/Gui/GUIBase.py') diff --git a/Mailman/Gui/GUIBase.py b/Mailman/Gui/GUIBase.py index a5437009..88288afa 100644 --- a/Mailman/Gui/GUIBase.py +++ b/Mailman/Gui/GUIBase.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2003 by the Free Software Foundation, Inc. +# Copyright (C) 2002-2004 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 @@ -122,6 +122,9 @@ class GUIBase: # Validate all the attributes for this category pass + def _escape(self, property, value): + return Utils.websafe(value) + def handleForm(self, mlist, category, subcat, cgidata, doc): for item in self.GetConfigInfo(mlist, category, subcat): # Skip descriptions and legacy non-attributes @@ -140,9 +143,10 @@ class GUIBase: elif not cgidata.has_key(property): continue elif isinstance(cgidata[property], ListType): - val = [Utils.websafe(x.value) for x in cgidata[property]] + val = [self._escape(property, x.value) + for x in cgidata[property]] else: - val = Utils.websafe(cgidata[property].value) + val = self._escape(property, cgidata[property].value) # Coerce the value to the expected type, raising exceptions if the # value is invalid. try: -- cgit v1.2.3