Fix html with links sanitization

Globalize attribute accessors were arriving here as Strings intead of
ActiveSupport::SafeBuffer so they were not sanitized correctly.
This commit is contained in:
Senén Rodero Rodríguez
2018-12-23 12:02:14 +01:00
committed by voodoorai2000
parent 5881f8241e
commit 4f0d1399f2

View File

@@ -8,6 +8,7 @@ module TextWithLinksHelper
def safe_html_with_links(html)
return if html.nil?
html = ActiveSupport::SafeBuffer.new(html) if html.is_a?(String)
return html.html_safe unless html.html_safe?
Rinku.auto_link(html, :all, 'target="_blank" rel="nofollow"').html_safe
end