diff options
author | Mark Sapiro <msapiro@value.net> | 2011-05-01 09:21:29 -0700 |
---|---|---|
committer | Mark Sapiro <msapiro@value.net> | 2011-05-01 09:21:29 -0700 |
commit | 68c8d57f95b53ed2dc204bf0ee617c650df00c9a (patch) | |
tree | 217dbad0255528fc96cb9678de96fde074debb55 /Mailman/Utils.py | |
parent | 0740ae72a79a9027a484e4d17adad91142c8df83 (diff) | |
download | mailman2-68c8d57f95b53ed2dc204bf0ee617c650df00c9a.tar.gz mailman2-68c8d57f95b53ed2dc204bf0ee617c650df00c9a.tar.xz mailman2-68c8d57f95b53ed2dc204bf0ee617c650df00c9a.zip |
Made the web escaping of additional characters a configuration setting.
Diffstat (limited to '')
-rw-r--r-- | Mailman/Utils.py | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/Mailman/Utils.py b/Mailman/Utils.py index f9a4e690..c93df81f 100644 --- a/Mailman/Utils.py +++ b/Mailman/Utils.py @@ -425,19 +425,13 @@ def check_global_password(response, siteadmin=True): _ampre = re.compile('&((?:#[0-9]+|[a-z]+);)', re.IGNORECASE) -# Characters misinterpreted as < or > by some broken browsers. -_broken_browser = {'\x8b': '‹', - '\x9b': '›', - '\xbc': '¼', - '\xbe': '¾', - '\xa2': '¢' - } def websafe(s): - # Archiver can pass unicode here. Just skip them as the - # archiver escapes non-ascii anyway. - if isinstance(s, str): - for k in _broken_browser: - s = s.replace(k, _broken_browser[k]) + if mm_cfg.BROKEN_BROWSER_WORKAROUND: + # Archiver can pass unicode here. Just skip them as the + # archiver escapes non-ascii anyway. + if isinstance(s, str): + for k in mm_cfg.BROKEN_BROWSER_REPLACEMENTS: + s = s.replace(k, mm_cfg.BROKEN_BROWSER_REPLACEMENTS[k]) # Don't double escape html entities return _ampre.sub(r'&\1', cgi.escape(s, quote=True)) |