Skip to content

Commit

Permalink
Fixes #35977 - html_escape host-comment in index
Browse files Browse the repository at this point in the history
(cherry picked from commit b7f865d)
  • Loading branch information
m-bucher authored and ekohl committed Jan 27, 2023
1 parent 454fe23 commit 9dc1c46
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/views/hosts/_list.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<td hidden="true" class="hidden-tablet hidden-xs ellipsis"><%= host_owner_column(host) %></td>
<td hidden="true" class="hidden-tablet hidden-xs"><%= label_with_link host.hostgroup, 23, @hostgroup_authorizer %></td>
<td hidden="true" class="hidden-tablet hidden-xs ellipsis"><%= last_report_column(host) %></td>
<td hidden="true" class="hidden-tablet hidden-xs ca" title="<%= host.comment&.truncate(255) %>"><%= icon_text('comment', '') unless host.comment.empty? %></td>
<td hidden="true" class="hidden-tablet hidden-xs ca" title="<%= h host.comment&.truncate(255) %>"><%= icon_text('comment', '') unless host.comment.empty? %></td>
<td>
<%= action_buttons(
display_link_if_authorized(_("Edit"), hash_for_edit_host_path(:id => host).merge(:auth_object => host, :authorizer => authorizer)),
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/foreman_register.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
add_pagelet :hosts_table_column_header, key: :last_report, label: _('Last report'), sortable: true, default_sort: 'DESC', width: '10%', class: common_th_class
add_pagelet :hosts_table_column_content, key: :last_report, class: common_td_class, callback: ->(host) { last_report_column(host) }
add_pagelet :hosts_table_column_header, key: :comment, label: _('Comment'), sortable: true, width: '7%', class: common_th_class
add_pagelet :hosts_table_column_content, key: :comment, class: common_th_class + ' ca', attr_callbacks: { title: ->(host) { host.comment&.truncate(255) } }, callback: ->(host) { icon_text('comment', '') unless host.comment.empty? }
add_pagelet :hosts_table_column_content, key: :comment, class: common_th_class + ' ca', attr_callbacks: { title: ->(host) { h host.comment&.truncate(255) } }, callback: ->(host) { icon_text('comment', '') unless host.comment.empty? }
end
ctx.with_profile :network_data, _('Network'), default: false do
common_th_class = 'hidden-tablet hidden-xs'
Expand Down

0 comments on commit 9dc1c46

Please sign in to comment.