]> source.dussan.org Git - redmine.git/commitdiff
Ruby 2.7: FrozenError when new LDAP users try to login (#35135).
authorGo MAEDA <maeda@farend.jp>
Fri, 23 Apr 2021 03:02:24 +0000 (03:02 +0000)
committerGo MAEDA <maeda@farend.jp>
Fri, 23 Apr 2021 03:02:24 +0000 (03:02 +0000)
Patch by Pavel Rosický.

git-svn-id: http://svn.redmine.org/redmine/trunk@20966 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/auth_source_ldap.rb

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