diff --git a/lib/email/message_builder.rb b/lib/email/message_builder.rb index 9e4a5b9f6..8cb268a3e 100644 --- a/lib/email/message_builder.rb +++ b/lib/email/message_builder.rb @@ -69,7 +69,7 @@ module Email def body body = @opts[:body] - body = I18n.t("#{@opts[:template]}.text_body_template", template_args) if @opts[:template] + body = I18n.t("#{@opts[:template]}.text_body_template", template_args).dup if @opts[:template] if @opts[:add_unsubscribe_link] body << "\n" diff --git a/lib/freedom_patches/translate_accelerator.rb b/lib/freedom_patches/translate_accelerator.rb index 3c1d93c26..88d06b35f 100644 --- a/lib/freedom_patches/translate_accelerator.rb +++ b/lib/freedom_patches/translate_accelerator.rb @@ -16,10 +16,10 @@ module I18n k = [args,config.locale,config.backend.object_id] t = @cache.fetch(k){found=false} unless found - t = @cache[k] = translate_no_cache(*args) + t = @cache[k] = translate_no_cache(*args).freeze end - t.dup + t end alias_method :t, :translate diff --git a/lib/pretty_text.rb b/lib/pretty_text.rb index ff36fd5c1..c0344dd01 100644 --- a/lib/pretty_text.rb +++ b/lib/pretty_text.rb @@ -12,6 +12,7 @@ module PrettyText if opts # TODO: server localisation has no parity with client # should be fixed + str = str.dup opts.each do |k,v| str.gsub!("{{#{k}}}", v) end diff --git a/lib/site_content_class_methods.rb b/lib/site_content_class_methods.rb index 5bc553f5e..faa493e51 100644 --- a/lib/site_content_class_methods.rb +++ b/lib/site_content_class_methods.rb @@ -25,9 +25,9 @@ module SiteContentClassMethods result = "" if site_content.blank? ct = find_content_type(content_type) - result = ct.default_content if ct.present? + result = ct.default_content.dup if ct.present? else - result = site_content.content + result = site_content.content.dup end result.gsub!(/\%\{[^}]+\}/) do |m|