areguera / rpms / mailman

Forked from rpms/mailman 5 years ago
Clone

Blame SOURCES/mailman-findmember_decode.patch

7812c9
--- a/Mailman/Cgi/admin.py	2015-03-09 20:37:28 +0000
7812c9
+++ b/Mailman/Cgi/admin.py	2015-04-13 22:17:02 +0000
7812c9
@@ -911,6 +911,15 @@
7812c9
     all.sort(lambda x, y: cmp(x.lower(), y.lower()))
7812c9
     # See if the query has a regular expression
7812c9
     regexp = cgidata.getvalue('findmember', '').strip()
7812c9
+    try:
7812c9
+        regexp = regexp.decode(Utils.GetCharSet(mlist.preferred_language))
7812c9
+    except UnicodeDecodeError:
7812c9
+        # This is probably a non-ascii character and an English language
7812c9
+        # (ascii) list.  Even if we didn't throw the UnicodeDecodeError,
7812c9
+        # the input may have contained mnemonic or numeric HTML entites mixed
7812c9
+        # with other characters.  Trying to grok the real meaning out of that
7812c9
+        # is complex and error prone, so we don't try.
7812c9
+        pass
7812c9
     if regexp:
7812c9
         try:
7812c9
             cre = re.compile(regexp, re.IGNORECASE)
7812c9