Commit 873f1d46d2dc8e0da70e66d6cd57341a31b4b285
1 parent
f6703513
Exists in
master
and in
29 other branches
[ldap plugin] Updated readme
Also changed method used to guess encoding
Showing
2 changed files
with
2 additions
and
1 deletions
Show diff stats
plugins/ldap/README.md
plugins/ldap/lib/ldap_authentication.rb
... | ... | @@ -136,7 +136,7 @@ class LdapAuthentication |
136 | 136 | def self.get_attr(entry, attr_name) |
137 | 137 | if !attr_name.blank? |
138 | 138 | val = entry[attr_name].is_a?(Array) ? entry[attr_name].first : entry[attr_name] |
139 | - charset = Magic.guess_string_mime(val).match(/charset=([^\s]+)/)[1] | |
139 | + charset = Magic.guess_string_mime_encoding(val) | |
140 | 140 | val.encode 'utf-8', charset, invalid: :replace, undef: :replace |
141 | 141 | end |
142 | 142 | end | ... | ... |