From d74f0bfd5c53962e332c2dd4d30dafaa1105b92b Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 23 Jul 2017 11:26:04 +0000 Subject: Merged rails-5.1 branch (#23630). git-svn-id: http://svn.redmine.org/redmine/trunk@16859 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/safe_attributes.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/redmine/safe_attributes.rb') diff --git a/lib/redmine/safe_attributes.rb b/lib/redmine/safe_attributes.rb index 0bde0f970..a2711cc4b 100644 --- a/lib/redmine/safe_attributes.rb +++ b/lib/redmine/safe_attributes.rb @@ -80,6 +80,10 @@ module Redmine # Sets attributes from attrs that are safe # attrs is a Hash with string keys def safe_attributes=(attrs, user=User.current) + if attrs.respond_to?(:to_unsafe_hash) + attrs = attrs.to_unsafe_hash + end + return unless attrs.is_a?(Hash) self.attributes = delete_unsafe_attributes(attrs, user) end -- cgit v1.2.3