Use sanitize instead of html_safe
The difference is `html_safe` allows every HTML tag, including the `<script>` tag, while `sanitize` only allows tags which are considered safe. In this case, we want to allow a `<span>` tag in a translation, and links inside flash messages.
This commit is contained in:
@@ -26,8 +26,8 @@
|
||||
<h3>
|
||||
<%= group.name %> - <%= @ballot.heading_for_group(group).name %>
|
||||
</h3>
|
||||
<%= link_to t("budgets.ballots.show.remaining",
|
||||
amount: @ballot.formatted_amount_available(@ballot.heading_for_group(group))).html_safe,
|
||||
<%= link_to sanitize(t("budgets.ballots.show.remaining",
|
||||
amount: @ballot.formatted_amount_available(@ballot.heading_for_group(group)))),
|
||||
budget_group_path(@budget, group) %>
|
||||
</div>
|
||||
<% if @ballot.has_lines_in_group?(group) %>
|
||||
|
||||
Reference in New Issue
Block a user