Skip to content

Commit

Permalink
Fix Rails/OutputSafety
Browse files Browse the repository at this point in the history
  • Loading branch information
Splines committed Dec 14, 2023
1 parent c8addbf commit b26b11f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions app/helpers/notifications_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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)
Expand All @@ -57,15 +56,14 @@ 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
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
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/talks_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b26b11f

Please sign in to comment.