diff --git a/plugins/ldap/README.md b/plugins/ldap/README.md index b14ca97..706a440 100644 --- a/plugins/ldap/README.md +++ b/plugins/ldap/README.md @@ -13,6 +13,7 @@ Dependences See the Noosfero install file. After install Noosfero, install LDAP dependences: $ gem install net-ldap -v 0.3.1 +$ sudo apt-get install ruby-magic Enable Plugin ------------- diff --git a/plugins/ldap/lib/ldap_authentication.rb b/plugins/ldap/lib/ldap_authentication.rb index eaa7a18..7171858 100644 --- a/plugins/ldap/lib/ldap_authentication.rb +++ b/plugins/ldap/lib/ldap_authentication.rb @@ -136,7 +136,7 @@ class LdapAuthentication def self.get_attr(entry, attr_name) if !attr_name.blank? val = entry[attr_name].is_a?(Array) ? entry[attr_name].first : entry[attr_name] - charset = Magic.guess_string_mime(val).match(/charset=([^\s]+)/)[1] + charset = Magic.guess_string_mime_encoding(val) val.encode 'utf-8', charset, invalid: :replace, undef: :replace end end -- libgit2 0.21.2