safety check

This commit is contained in:
Andrew Brown 2021-03-12 08:56:31 -08:00
parent 7bc0a4747a
commit 00de9488ba

View File

@ -27,7 +27,9 @@ module ApplicationHelper
content_for(:title) { (parts << 'Notebook').join(' - ') } unless parts.empty?
end
def clean_links html
def clean_links(html)
return '' if html.nil?
html.gsub!(/\<a href=["'](.*?)["']\>(.*?)\<\/a\>/mi, '<a href="\1" rel="nofollow">\2</a>')
html.html_safe
end