diff options
author | Mark Sapiro <mark@msapiro.net> | 2015-04-13 15:17:02 -0700 |
---|---|---|
committer | Mark Sapiro <mark@msapiro.net> | 2015-04-13 15:17:02 -0700 |
commit | 0872fe8ebdb83e2f864c94201b57121e20c3fb7d (patch) | |
tree | c42aff58d1a40ee64cdb7620ae17cc0278c6e3e3 /Mailman | |
parent | 3b09abab98d46292d0e95d214935316385dadf93 (diff) | |
download | mailman2-0872fe8ebdb83e2f864c94201b57121e20c3fb7d.tar.gz mailman2-0872fe8ebdb83e2f864c94201b57121e20c3fb7d.tar.xz mailman2-0872fe8ebdb83e2f864c94201b57121e20c3fb7d.zip |
Improved search in admin UI Membership List.
Diffstat (limited to 'Mailman')
-rw-r--r-- | Mailman/Cgi/admin.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Mailman/Cgi/admin.py b/Mailman/Cgi/admin.py index 4cd619bb..370a2507 100644 --- a/Mailman/Cgi/admin.py +++ b/Mailman/Cgi/admin.py @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2014 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2015 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 @@ -911,6 +911,15 @@ def membership_options(mlist, subcat, cgidata, doc, form): all.sort(lambda x, y: cmp(x.lower(), y.lower())) # See if the query has a regular expression regexp = cgidata.getvalue('findmember', '').strip() + try: + regexp = regexp.decode(Utils.GetCharSet(mlist.preferred_language)) + except UnicodeDecodeError: + # This is probably a non-ascii character and an English language + # (ascii) list. Even if we didn't throw the UnicodeDecodeError, + # the input may have contained mnemonic or numeric HTML entites mixed + # with other characters. Trying to grok the real meaning out of that + # is complex and error prone, so we don't try. + pass if regexp: try: cre = re.compile(regexp, re.IGNORECASE) |