diff options
Diffstat (limited to 'Mailman/Utils.py')
-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)) |