mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 02:22:40 +08:00
FIX: Don't sanitize header_instructions
This commit is contained in:
@ -69,19 +69,20 @@ module Email
|
|||||||
|
|
||||||
header_instructions = @template_args[:header_instructions]
|
header_instructions = @template_args[:header_instructions]
|
||||||
if header_instructions.present?
|
if header_instructions.present?
|
||||||
header_instructions = PrettyText.cook(header_instructions).html_safe
|
header_instructions = PrettyText.cook(header_instructions, sanitize: false).html_safe
|
||||||
html_override.gsub!("%{header_instructions}", header_instructions)
|
html_override.gsub!("%{header_instructions}", header_instructions)
|
||||||
else
|
else
|
||||||
html_override.gsub!("%{header_instructions}", "")
|
html_override.gsub!("%{header_instructions}", "")
|
||||||
end
|
end
|
||||||
|
|
||||||
if response_instructions = @template_args[:respond_instructions]
|
if response_instructions = @template_args[:respond_instructions]
|
||||||
respond_instructions = PrettyText.cook(response_instructions).html_safe
|
respond_instructions = PrettyText.cook(response_instructions, sanitize: false).html_safe
|
||||||
html_override.gsub!("%{respond_instructions}", respond_instructions)
|
html_override.gsub!("%{respond_instructions}", respond_instructions)
|
||||||
else
|
else
|
||||||
html_override.gsub!("%{respond_instructions}", "")
|
html_override.gsub!("%{respond_instructions}", "")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
styled = Email::Styles.new(html_override, @opts)
|
styled = Email::Styles.new(html_override, @opts)
|
||||||
styled.format_basic
|
styled.format_basic
|
||||||
|
|
||||||
|
@ -187,7 +187,7 @@ module PrettyText
|
|||||||
decorate_context(context)
|
decorate_context(context)
|
||||||
|
|
||||||
context_opts = opts || {}
|
context_opts = opts || {}
|
||||||
context_opts[:sanitize] ||= true
|
context_opts[:sanitize] = true unless context_opts[:sanitize] == false
|
||||||
context['opts'] = context_opts
|
context['opts'] = context_opts
|
||||||
context['raw'] = text
|
context['raw'] = text
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user