diff options
author | bwarsaw <> | 2004-02-17 19:21:11 +0000 |
---|---|---|
committer | bwarsaw <> | 2004-02-17 19:21:11 +0000 |
commit | 19b7fa435db9c4e311f05c274d2d49a685cf4af6 (patch) | |
tree | 4398cf86351743a422f198b6d2452dad9f2002a9 | |
parent | 648fc8b948eeca744e76b33b519687cc638cd96a (diff) | |
download | mailman2-19b7fa435db9c4e311f05c274d2d49a685cf4af6.tar.gz mailman2-19b7fa435db9c4e311f05c274d2d49a685cf4af6.tar.xz mailman2-19b7fa435db9c4e311f05c274d2d49a685cf4af6.zip |
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().
-rw-r--r-- | Mailman/Gui/GUIBase.py | 10 |
1 files changed, 7 insertions, 3 deletions
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: |