summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-03-08 17:41:43 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-03-08 17:41:43 +0000
commit7c9f3b5b4364ddef2a54a1ce853415d2e3c13906 (patch)
tree7144b76de691b93fa2197a258cff14e7cab38be0 /app
parenta5b18b631ceb31c4c0fc7b0bec1ebdb0285e762a (diff)
downloadredmine-7c9f3b5b4364ddef2a54a1ce853415d2e3c13906.tar.gz
redmine-7c9f3b5b4364ddef2a54a1ce853415d2e3c13906.zip
Reverts r14067 that triggers "can't modify frozen String" errors (#19305).
git-svn-id: http://svn.redmine.org/redmine/trunk@14068 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/models/setting.rb22
1 files changed, 1 insertions, 21 deletions
diff --git a/app/models/setting.rb b/app/models/setting.rb
index cc4131bec..ca280ebcd 100644
--- a/app/models/setting.rb
+++ b/app/models/setting.rb
@@ -91,10 +91,7 @@ class Setting < ActiveRecord::Base
def value
v = read_attribute(:value)
# Unserialize serialized settings
- if available_settings[name]['serialized'] && v.is_a?(String)
- v = YAML::load(v)
- force_utf8_strings(v)
- end
+ v = YAML::load(v) if available_settings[name]['serialized'] && v.is_a?(String)
v = v.to_sym if available_settings[name]['format'] == 'symbol' && !v.blank?
v
end
@@ -241,23 +238,6 @@ END_SRC
load_plugin_settings
private
-
- def force_utf8_strings(arg)
- if arg.is_a?(String)
- arg.force_encoding('UTF-8')
- elsif arg.is_a?(Array)
- arg.each do |a|
- force_utf8_strings(a)
- end
- elsif arg.is_a?(Hash)
- arg.each do |k,v|
- force_utf8_strings(k)
- force_utf8_strings(v)
- end
- end
- arg
- end
-
# Returns the Setting instance for the setting named name
# (record found in database or new record with default value)
def self.find_or_default(name)