Files
grecia/app/views/polls/_callout.html.erb
Javi Martín 6b1864fbcd Sanitize translations instead of using _html
Using the `_html` suffix in an i18n key is the same as using `html_safe`
on it, which means that translation could potentially be used for XSS
attacks.
2019-10-09 19:46:47 +02:00

23 lines
773 B
Plaintext

<% unless can?(:answer, @poll) %>
<% if current_user.nil? %>
<div class="callout primary">
<%= sanitize(t("polls.show.cant_answer_not_logged_in",
signin: link_to_signin(class: "probe-message"),
signup: link_to_signup(class: "probe-message"))) %>
</div>
<% elsif current_user.unverified? %>
<div class="callout warning">
<%= sanitize(t("polls.show.cant_answer_verify",
verify_link: link_to(t("polls.show.verify_link"), verification_path))) %>
</div>
<% elsif @poll.expired? %>
<div class="callout alert">
<%= t("polls.show.cant_answer_expired") %>
</div>
<% else %>
<div class="callout warning">
<%= t("polls.show.cant_answer_wrong_geozone") %>
</div>
<% end %>
<% end %>