Skip to content

Commit

Permalink
Merge pull request #37 from hitobito/render_educations_columns_correctly
Browse files Browse the repository at this point in the history
Make educations columns html safe after sanitizing qualification kind label
  • Loading branch information
TheWalkingLeek authored Oct 30, 2023
2 parents b52e718 + 7290309 commit eb643df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/helpers/group_educations_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ def joined_qualification_kind_labels(person)
reverse.
uniq(&:qualification_kind).
collect do |q|
label = "#{q.qualification_kind.label} #{format_attr(q, :finish_at)}".strip
label = "#{h(q.qualification_kind.label)} #{format_attr(q, :finish_at)}".strip
content_tag(:span, label, class: qualification_label_class(q))
end.
join('<br/>')
join('<br/>').
html_safe
end

def joined_event_participations(person)
Expand All @@ -30,7 +31,8 @@ def joined_event_participations(person)
collect do |p|
format_open_participation_event(p)
end.
join(', ')
join(', ').
html_safe
end

def format_open_participation_event(participation)
Expand Down
1 change: 1 addition & 0 deletions spec/helpers/group_educations_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
include LayoutHelper
include UtilityHelper
include QualificationsHelper
include ERB::Util

subject { joined_qualification_kind_labels(user) }

Expand Down

0 comments on commit eb643df

Please sign in to comment.