aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman/Utils.py
diff options
context:
space:
mode:
authorMark Sapiro <msapiro@value.net>2011-05-01 09:21:29 -0700
committerMark Sapiro <msapiro@value.net>2011-05-01 09:21:29 -0700
commit68c8d57f95b53ed2dc204bf0ee617c650df00c9a (patch)
tree217dbad0255528fc96cb9678de96fde074debb55 /Mailman/Utils.py
parent0740ae72a79a9027a484e4d17adad91142c8df83 (diff)
downloadmailman2-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.py18
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('&amp;((?:#[0-9]+|[a-z]+);)', re.IGNORECASE)
-# Characters misinterpreted as < or > by some broken browsers.
-_broken_browser = {'\x8b': '&#8249;',
- '\x9b': '&#8250;',
- '\xbc': '&#188;',
- '\xbe': '&#190;',
- '\xa2': '&#162;'
- }
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))