From a82eda5621b15ae74cb4e9843597c3225871f9a1 Mon Sep 17 00:00:00 2001 From: Arnaud Levy <contact@arnaudlevy.com> Date: Wed, 16 Feb 2022 16:51:11 +0100 Subject: [PATCH] default sanitize for static --- app/helpers/admin/application_helper.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/helpers/admin/application_helper.rb b/app/helpers/admin/application_helper.rb index 802c70113..5fc9a7876 100644 --- a/app/helpers/admin/application_helper.rb +++ b/app/helpers/admin/application_helper.rb @@ -66,9 +66,7 @@ module Admin::ApplicationHelper def prepare_html_for_static(html, university) text = html.to_s - text = sanitize text, - tags: %w(table figure figcaption strong em b i u p code pre tt samp kbd var sub sup dfn cite big small address hr br span h1 h2 h3 h4 h5 h6 ul ol li dl dt dd abbr acronym a img blockquote del ins), - attributes: %w(rel href src srcset width height alt cite datetime title class name xml:lang abbr style target) + text = sanitize text text.gsub! "\r", '' text.gsub! "\n", ' ' text.gsub! "/rails/active_storage", "#{university.url}/rails/active_storage" -- GitLab