From b26b11f2d9985f63af981946ea1551a08c61659d Mon Sep 17 00:00:00 2001 From: Splines Date: Thu, 14 Dec 2023 17:13:34 +0100 Subject: [PATCH] Fix Rails/OutputSafety --- app/helpers/notifications_helper.rb | 9 +++------ app/helpers/talks_helper.rb | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/app/helpers/notifications_helper.rb b/app/helpers/notifications_helper.rb index 29859969f..be7160ec2 100644 --- a/app/helpers/notifications_helper.rb +++ b/app/helpers/notifications_helper.rb @@ -33,7 +33,7 @@ def notification_color(notification) # provide text or link for header of notification card def notification_header(notification) notifiable = notification.notifiable - text = if notification.medium? + if notification.medium? medium_notification_card_header(notifiable) elsif notification.course? || notification.lecture? t("notifications.course_selection") @@ -42,13 +42,12 @@ def notification_header(notification) else link_to(t("mampf_news.title"), news_path, class: "text-dark") end - text.html_safe # rubocop:todo Rails/OutputSafety end # provide text for body of notification card def notification_text(notification) notifiable = notification.notifiable - text = if notification.medium? + if notification.medium? t("notifications.new_medium") elsif notification.course? course_notification_card_text(notifiable) @@ -57,7 +56,6 @@ def notification_text(notification) else t("notifications.new_announcement") end - text.html_safe # rubocop:todo Rails/OutputSafety end # provide link for body of notification card @@ -65,7 +63,7 @@ def notification_link(notification) notifiable = notification.notifiable return "" unless notifiable - text = if notification.medium? + if notification.medium? medium_notification_card_link(notifiable) elsif notification.course? course_notification_card_link @@ -74,7 +72,6 @@ def notification_link(notification) else notifiable.details end - text.html_safe # rubocop:todo Rails/OutputSafety end def items_card_size(small, comments_below) diff --git a/app/helpers/talks_helper.rb b/app/helpers/talks_helper.rb index 8a97f0f40..8f17c847b 100644 --- a/app/helpers/talks_helper.rb +++ b/app/helpers/talks_helper.rb @@ -32,7 +32,7 @@ def speaker_icon(talk) end def speaker_list_with_icon(talk) - (speaker_icon(talk) + speaker_list(talk)).html_safe # rubocop:todo Rails/OutputSafety + speaker_icon(talk) + speaker_list(talk) end def date_list(talk)