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:
committed by
voodoorai2000
parent
5881f8241e
commit
4f0d1399f2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user