From 624cdea92a6d8b1fc20de026596245f36a391280 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 9 Jan 2016 10:17:12 +0000 Subject: LDAP account creation fails when first name/last name contain non ASCII (#21453). Patch by Haihan Ji. git-svn-id: http://svn.redmine.org/redmine/trunk@15024 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/auth_source_ldap.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/models/auth_source_ldap.rb') diff --git a/app/models/auth_source_ldap.rb b/app/models/auth_source_ldap.rb index d5a8550c7..696d6219d 100644 --- a/app/models/auth_source_ldap.rb +++ b/app/models/auth_source_ldap.rb @@ -197,7 +197,8 @@ class AuthSourceLdap < AuthSource def self.get_attr(entry, attr_name) if !attr_name.blank? - entry[attr_name].is_a?(Array) ? entry[attr_name].first : entry[attr_name] + value = entry[attr_name].is_a?(Array) ? entry[attr_name].first : entry[attr_name] + value.force_encoding('UTF-8') end end end -- cgit v1.2.3