Fix HTML escaping issues with user role icons

This commit is contained in:
Tom Hughes 2020-11-13 15:13:37 +00:00
parent bfffe7ed96
commit 99e537859a
4 changed files with 8 additions and 16 deletions

View file

@ -1,8 +1,6 @@
module UserRolesHelper
def role_icons(user)
UserRole::ALL_ROLES.reduce("".html_safe) do |acc, elem|
"#{acc} #{role_icon(user, elem)}"
end
safe_join(UserRole::ALL_ROLES.collect { |role| role_icon(user, role) }.compact, " ")
end
def role_icon(user, role)