<% if experiment.description.present? %>
- <%= auto_link(smart_annotation_parser(simple_format(sanitize_input(experiment.description))),
- link: :urls,
- sanitize: false,
- html: { target: '_blank' }).html_safe %>
+ <%= custom_auto_link(experiment.description) %>
<% else %>
<% end %>
diff --git a/app/views/reports/elements/_my_module_element.html.erb b/app/views/reports/elements/_my_module_element.html.erb
index 0158b6c75..13558587a 100644
--- a/app/views/reports/elements/_my_module_element.html.erb
+++ b/app/views/reports/elements/_my_module_element.html.erb
@@ -30,8 +30,7 @@
<% if my_module.description.present? %>
- <%= custom_auto_link(simple_format(my_module.description),
- link: :urls, html: { target: '_blank' }) %>
+ <%= custom_auto_link(my_module.description) %>
<% else %>
<%=t "projects.reports.elements.module.no_description" %>
<% end %>
diff --git a/app/views/reports/elements/_result_comments_element.html.erb b/app/views/reports/elements/_result_comments_element.html.erb
index 724767ef7..9d643f55c 100644
--- a/app/views/reports/elements/_result_comments_element.html.erb
+++ b/app/views/reports/elements/_result_comments_element.html.erb
@@ -31,10 +31,7 @@
<% end %>
diff --git a/app/views/reports/elements/_result_text_element.html.erb b/app/views/reports/elements/_result_text_element.html.erb
index afae2a4ce..69a4fd40f 100644
--- a/app/views/reports/elements/_result_text_element.html.erb
+++ b/app/views/reports/elements/_result_text_element.html.erb
@@ -23,10 +23,7 @@
- <%= auto_link(smart_annotation_parser(simple_format(sanitize_input(result_text.text))),
- link: :urls,
- sanitize: false,
- html: { target: '_blank' }).html_safe %>
+ <%= custom_auto_link(result_text.text, false) %>
diff --git a/app/views/reports/elements/_step_checklist_element.html.erb b/app/views/reports/elements/_step_checklist_element.html.erb
index 963bfa80a..d674fd35e 100644
--- a/app/views/reports/elements/_step_checklist_element.html.erb
+++ b/app/views/reports/elements/_step_checklist_element.html.erb
@@ -8,10 +8,7 @@
- <%= auto_link(smart_annotation_parser(simple_format(t 'projects.reports.elements.step_checklist.checklist_name', name: checklist.name)),
- link: :urls,
- sanitize: false,
- html: { target: '_blank' }).html_safe %>
+ <%= custom_auto_link(t('projects.reports.elements.step_checklist.checklist_name', name: checklist.name)) %>
<%=t 'projects.reports.elements.step_checklist.user_time', timestamp: l(timestamp, format: :full) %>
@@ -27,10 +24,8 @@
/>
- <%= auto_link(smart_annotation_parser(simple_format(sanitize_input(item.text))),
- link: :urls,
- sanitize: false,
- html: { target: '_blank' }).html_safe %>
+ <%= custom_auto_link(item.text) %>
+
<% end %>
diff --git a/app/views/reports/elements/_step_comments_element.html.erb b/app/views/reports/elements/_step_comments_element.html.erb
index 40d5d2731..9ca7fb14e 100644
--- a/app/views/reports/elements/_step_comments_element.html.erb
+++ b/app/views/reports/elements/_step_comments_element.html.erb
@@ -31,10 +31,7 @@
<% end %>
diff --git a/app/views/reports/elements/_step_element.html.erb b/app/views/reports/elements/_step_element.html.erb
index cf142f656..ced4d19f4 100644
--- a/app/views/reports/elements/_step_element.html.erb
+++ b/app/views/reports/elements/_step_element.html.erb
@@ -27,10 +27,7 @@
<% if strip_tags(step.description).present? %>
- <%= auto_link(smart_annotation_parser(simple_format(sanitize_input(step.description))),
- link: :urls,
- sanitize: false,
- html: { target: '_blank' }).html_safe %>
+ <%= custom_auto_link(step.description, false) %>
<% else %>
<%=t "projects.reports.elements.step.no_description" %>
<% end %>
diff --git a/app/views/reports/report.pdf.erb b/app/views/reports/report.pdf.erb
index 8ed7c223b..fb6e33ea7 100644
--- a/app/views/reports/report.pdf.erb
+++ b/app/views/reports/report.pdf.erb
@@ -9,7 +9,8 @@
- <%= sanitize_input(@html) %>
+ <% # Also whitelist
![]()
and
tags %>
+ <%= sanitize_input(@html, ['img', 'input'], ['type', 'disabled', 'checked']) %>