]> source.dussan.org Git - redmine.git/commitdiff
Stringify the attribute value before #force_enconding (#21453).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 9 Jan 2016 10:18:11 +0000 (10:18 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 9 Jan 2016 10:18:11 +0000 (10:18 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@15025 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/auth_source_ldap.rb

index 696d6219d5c7c0f833221701624f79d10c436fb3..b18b657b03f4067e66d8dcd4e522c3c77a0ebb08 100644 (file)
@@ -198,7 +198,7 @@ class AuthSourceLdap < AuthSource
   def self.get_attr(entry, attr_name)
     if !attr_name.blank?
       value = entry[attr_name].is_a?(Array) ? entry[attr_name].first : entry[attr_name]
-      value.force_encoding('UTF-8')
+      value.to_s.force_encoding('UTF-8')
     end
   end
 end