From 94f58d647cebf3e573615c0f41a45a8a71b6aa71 Mon Sep 17 00:00:00 2001 From: Alexandre Fayolle Date: Fri, 12 Feb 2016 11:52:47 +0100 Subject: [PATCH] [FIX] auth_ldap: fix authentication with special chars encode the filter in utf-8 This prevents a UnicodeDecode error in python-ldap when the filter contains non ascii characters. opw-682783 closes #10899 closes #12710 --- addons/auth_ldap/users_ldap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/auth_ldap/users_ldap.py b/addons/auth_ldap/users_ldap.py index c920268643b..16084af80f2 100644 --- a/addons/auth_ldap/users_ldap.py +++ b/addons/auth_ldap/users_ldap.py @@ -102,7 +102,7 @@ class CompanyLDAP(osv.osv): _logger.warning('Could not format LDAP filter. Your filter should contain one \'%s\'.') return False try: - results = self.query(conf, filter) + results = self.query(conf, filter.encode('utf-8')) # Get rid of (None, attrs) for searchResultReference replies results = [i for i in results if i[0]]