diff --git a/app/views/budgets/index.html.erb b/app/views/budgets/index.html.erb index 2a23575d4..3ad23eec3 100644 --- a/app/views/budgets/index.html.erb +++ b/app/views/budgets/index.html.erb @@ -37,14 +37,14 @@ class: "button margin-top expanded" %> <% else %>
- <%= t("budgets.investments.index.sidebar.verified_only", - verify: link_to_verify_account).html_safe %> + <%= sanitize(t("budgets.investments.index.sidebar.verified_only", + verify: link_to_verify_account)) %>
<% end %> <% else %>
- <%= t("budgets.investments.index.sidebar.not_logged_in", - sign_in: link_to_signin, sign_up: link_to_signup).html_safe %> + <%= sanitize(t("budgets.investments.index.sidebar.not_logged_in", + sign_in: link_to_signin, sign_up: link_to_signup)) %>
<% end %> <% end %> diff --git a/app/views/budgets/investments/_ballot.html.erb b/app/views/budgets/investments/_ballot.html.erb index ae027b2fc..73fe2fe8b 100644 --- a/app/views/budgets/investments/_ballot.html.erb +++ b/app/views/budgets/investments/_ballot.html.erb @@ -51,11 +51,11 @@

- <%= t("budgets.ballots.reasons_for_not_balloting.#{reason}", + <%= sanitize(t("budgets.ballots.reasons_for_not_balloting.#{reason}", verify_account: link_to_verify_account, signin: link_to_signin, signup: link_to_signup, my_heading: my_heading, change_ballot: change_ballot, - heading_link: heading_link(@assigned_heading, @budget)).html_safe %> + heading_link: heading_link(@assigned_heading, @budget))) %>

diff --git a/app/views/budgets/investments/_header.html.erb b/app/views/budgets/investments/_header.html.erb index 48f78411b..e46e2d287 100644 --- a/app/views/budgets/investments/_header.html.erb +++ b/app/views/budgets/investments/_header.html.erb @@ -40,9 +40,9 @@ heading_link: heading_link(@assigned_heading, @budget)) %>
- <%= t("budgets.investments.header.change_ballot", + <%= sanitize(t("budgets.investments.header.change_ballot", check_ballot: link_to(t("budgets.investments.header.check_ballot_link"), - budget_ballot_path(@budget))).html_safe %> + budget_ballot_path(@budget)))) %> diff --git a/app/views/budgets/investments/_sidebar.html.erb b/app/views/budgets/investments/_sidebar.html.erb index 63d577241..b962db9e4 100644 --- a/app/views/budgets/investments/_sidebar.html.erb +++ b/app/views/budgets/investments/_sidebar.html.erb @@ -6,17 +6,17 @@ new_budget_investment_path(budget_id: @budget.id), class: "button budget expanded" %> <% else %>
- <%= t("budgets.investments.index.sidebar.verified_only", - verify: link_to_verify_account).html_safe %> + <%= sanitize(t("budgets.investments.index.sidebar.verified_only", + verify: link_to_verify_account)) %>
<% end %> <% end %> <% if @heading && can?(:show, @ballot) %>

- <%= t("budgets.investments.index.sidebar.voted_info", + <%= sanitize(t("budgets.investments.index.sidebar.voted_info", link: link_to(t("budgets.investments.index.sidebar.voted_info_link"), - budget_ballot_path(@budget))).html_safe %> + budget_ballot_path(@budget)))) %>

<% end %> @@ -52,9 +52,9 @@ ) %>
- <%= t("budgets.investments.index.sidebar.change_ballot", + <%= sanitize(t("budgets.investments.index.sidebar.change_ballot", check_ballot: link_to(t("budgets.investments.index.sidebar.check_ballot_link"), - budget_ballot_path(@budget))).html_safe %> + budget_ballot_path(@budget)))) %>

<% else %> diff --git a/app/views/budgets/investments/_votes.html.erb b/app/views/budgets/investments/_votes.html.erb index 9fca61f6e..b4733a29b 100644 --- a/app/views/budgets/investments/_votes.html.erb +++ b/app/views/budgets/investments/_votes.html.erb @@ -31,13 +31,13 @@ diff --git a/app/views/budgets/show.html.erb b/app/views/budgets/show.html.erb index 4cf4330a1..826752248 100644 --- a/app/views/budgets/show.html.erb +++ b/app/views/budgets/show.html.erb @@ -23,14 +23,14 @@ <%= link_to t("budgets.investments.index.sidebar.create"), new_budget_investment_path(@budget), class: "button margin-top expanded" %> <% else %>
- <%= t("budgets.investments.index.sidebar.verified_only", - verify: link_to_verify_account).html_safe %> + <%= sanitize(t("budgets.investments.index.sidebar.verified_only", + verify: link_to_verify_account)) %>
<% end %> <% else %>
- <%= t("budgets.investments.index.sidebar.not_logged_in", - sign_in: link_to_signin, sign_up: link_to_signup).html_safe %> + <%= sanitize(t("budgets.investments.index.sidebar.not_logged_in", + sign_in: link_to_signin, sign_up: link_to_signup)) %>
<% end %> <% end %> diff --git a/app/views/comments/_comment_tree.html.erb b/app/views/comments/_comment_tree.html.erb index 9e95cc748..78acd65c4 100644 --- a/app/views/comments/_comment_tree.html.erb +++ b/app/views/comments/_comment_tree.html.erb @@ -24,7 +24,7 @@ <% elsif require_verified_resident_for_commentable?(commentable, current_user) %>
- <%= t("comments.verified_only", verify_account: link_to_verify_account).html_safe %> + <%= sanitize(t("comments.verified_only", verify_account: link_to_verify_account)) %>
<% elsif allow_comments %> <%= render "comments/form", { commentable: commentable, diff --git a/app/views/comments/_votes.html.erb b/app/views/comments/_votes.html.erb index 95e2ab60b..925c2d19f 100644 --- a/app/views/comments/_votes.html.erb +++ b/app/views/comments/_votes.html.erb @@ -81,9 +81,7 @@ <% end %> diff --git a/app/views/dashboard/mailer/new_actions_notification_on_create.html.erb b/app/views/dashboard/mailer/new_actions_notification_on_create.html.erb index b26d8f7f9..0f1df7ddd 100644 --- a/app/views/dashboard/mailer/new_actions_notification_on_create.html.erb +++ b/app/views/dashboard/mailer/new_actions_notification_on_create.html.erb @@ -6,7 +6,7 @@

<%= t("mailers.new_actions_notification_on_create.text_1") %>
- <%= t("mailers.new_actions_notification_on_create.text_2", link: proposal_dashboard_url(@proposal)).html_safe %> + <%= sanitize(t("mailers.new_actions_notification_on_create.text_2", link: proposal_dashboard_url(@proposal))) %>

<%= t("mailers.new_actions_notification_on_create.text_3") %>

<%= t("mailers.new_actions_notification_on_create.text_4") %>

diff --git a/app/views/dashboard/mailer/new_actions_notification_rake_created.html.erb b/app/views/dashboard/mailer/new_actions_notification_rake_created.html.erb index 479003d2e..7f4d74cb1 100644 --- a/app/views/dashboard/mailer/new_actions_notification_rake_created.html.erb +++ b/app/views/dashboard/mailer/new_actions_notification_rake_created.html.erb @@ -10,9 +10,9 @@ title: @proposal.title) %>

- <%= t("mailers.new_actions_notification_rake_created.text_1", + <%= sanitize(t("mailers.new_actions_notification_rake_created.text_1", link_to_published: link_to(proposal_dashboard_url(@proposal), - proposal_dashboard_url(@proposal))).html_safe %> + proposal_dashboard_url(@proposal)))) %>

<%= t("mailers.new_actions_notification_rake_created.text_2") %>


diff --git a/app/views/debates/_votes.html.erb b/app/views/debates/_votes.html.erb index cb7cdf9f5..9cd3437a4 100644 --- a/app/views/debates/_votes.html.erb +++ b/app/views/debates/_votes.html.erb @@ -52,7 +52,7 @@ <% elsif user_signed_in? && !debate.votable_by?(current_user) %> <% elsif !user_signed_in? %> diff --git a/app/views/debates/index.html.erb b/app/views/debates/index.html.erb index 53788434d..d4920644b 100644 --- a/app/views/debates/index.html.erb +++ b/app/views/debates/index.html.erb @@ -86,8 +86,8 @@

<%= t("debates.index.section_footer.description") %>

<%= t("debates.index.section_footer.help_text_1") %>

-

<%= t("debates.index.section_footer.help_text_2", - org: link_to(setting["org_name"], new_user_registration_path)).html_safe %>

+

<%= sanitize(t("debates.index.section_footer.help_text_2", + org: link_to(setting["org_name"], new_user_registration_path))) %>

<% end %> diff --git a/app/views/debates/new.html.erb b/app/views/debates/new.html.erb index 4e9368c2d..4e75679de 100644 --- a/app/views/debates/new.html.erb +++ b/app/views/debates/new.html.erb @@ -5,8 +5,8 @@

<%= t("debates.new.start_new") %>

- <%= t("debates.new.info", - info_link: link_to(t("debates.new.info_link"), new_proposal_path)).html_safe %> + <%= sanitize(t("debates.new.info", + info_link: link_to(t("debates.new.info_link"), new_proposal_path))) %> <% if feature?(:help_page) %> <%= link_to help_path, title: t("shared.target_blank"), target: "_blank" do %> diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index cba9e6ec0..d0d219c62 100644 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -4,8 +4,8 @@ <%= render "devise/omniauth_form" %>

- <%= t("devise_views.shared.links.signup", - signup_link: link_to(t("devise_views.shared.links.signup_link"), new_user_registration_path)).html_safe %> + <%= sanitize(t("devise_views.shared.links.signup", + signup_link: link_to(t("devise_views.shared.links.signup_link"), new_user_registration_path))) %>

<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %> diff --git a/app/views/direct_messages/new.html.erb b/app/views/direct_messages/new.html.erb index 30078978e..8c0635a26 100644 --- a/app/views/direct_messages/new.html.erb +++ b/app/views/direct_messages/new.html.erb @@ -9,8 +9,8 @@ <% if not current_user %>

- <%= t("users.login_to_continue", - signin: link_to_signin, signup: link_to_signup).html_safe %> + <%= sanitize(t("users.login_to_continue", + signin: link_to_signin, signup: link_to_signup)) %>

<% elsif not @receiver.email_on_direct_message? %> @@ -33,8 +33,8 @@ <% else %>

- <%= t("users.direct_messages.new.verified_only", - verify_account: link_to_verify_account).html_safe %> + <%= sanitize(t("users.direct_messages.new.verified_only", + verify_account: link_to_verify_account)) %>

<% end %> diff --git a/app/views/layouts/_footer.html.erb b/app/views/layouts/_footer.html.erb index 160134d8e..383469811 100644 --- a/app/views/layouts/_footer.html.erb +++ b/app/views/layouts/_footer.html.erb @@ -6,10 +6,9 @@

- <%= t("layouts.footer.description", + <%= sanitize(t("layouts.footer.description", open_source: link_to(t("layouts.footer.open_source"), t("layouts.footer.open_source_url"), target: "blank", rel: "nofollow"), - consul: link_to(t("layouts.footer.consul"), t("layouts.footer.consul_url"), target: "blank", rel: "nofollow")).html_safe - %> + consul: link_to(t("layouts.footer.consul"), t("layouts.footer.consul_url"), target: "blank", rel: "nofollow"))) %> <%= t("layouts.footer.contact_us") %>

diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 7fd5aee79..3c55f4f05 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -30,12 +30,12 @@

<%= t("layouts.application.ie_title") %>

- <%= t("layouts.application.ie", + <%= sanitize(t("layouts.application.ie", chrome: link_to( t("layouts.application.chrome"), "https://www.google.com/chrome/browser/desktop/", title: t("shared.target_blank"), target: "_blank"), firefox: link_to( t("layouts.application.firefox"), "https://www.mozilla.org/firefox", title: t("shared.target_blank"), target: "_blank") - ).html_safe %> + )) %>

diff --git a/app/views/legislation/annotations/_comments_box.html.erb b/app/views/legislation/annotations/_comments_box.html.erb index b9e8eea70..c1d1f24fd 100644 --- a/app/views/legislation/annotations/_comments_box.html.erb +++ b/app/views/legislation/annotations/_comments_box.html.erb @@ -37,8 +37,8 @@
diff --git a/app/views/legislation/processes/_help_gif.html.erb b/app/views/legislation/processes/_help_gif.html.erb index fdf00a2c5..19e47a506 100644 --- a/app/views/legislation/processes/_help_gif.html.erb +++ b/app/views/legislation/processes/_help_gif.html.erb @@ -11,8 +11,8 @@ <%= t("annotator.help.alt") %> <% else %>

- <%= t("annotator.help.text", - sign_in: link_to_signin, sign_up: link_to_signup).html_safe %> + <%= sanitize(t("annotator.help.text", + sign_in: link_to_signin, sign_up: link_to_signup)) %>

<% end %> diff --git a/app/views/legislation/proposals/_featured_votes.html.erb b/app/views/legislation/proposals/_featured_votes.html.erb index 090a095ea..979d2e90b 100644 --- a/app/views/legislation/proposals/_featured_votes.html.erb +++ b/app/views/legislation/proposals/_featured_votes.html.erb @@ -22,7 +22,7 @@ <% elsif user_signed_in? && !proposal.votable_by?(current_user) %> <% elsif !user_signed_in? %> diff --git a/app/views/legislation/proposals/_votes.html.erb b/app/views/legislation/proposals/_votes.html.erb index a2e9bedad..e60c4e2d4 100644 --- a/app/views/legislation/proposals/_votes.html.erb +++ b/app/views/legislation/proposals/_votes.html.erb @@ -54,8 +54,8 @@ <% elsif user_signed_in? && !proposal.votable_by?(current_user) %> <% elsif !user_signed_in? %> diff --git a/app/views/legislation/questions/_participation_not_allowed.html.erb b/app/views/legislation/questions/_participation_not_allowed.html.erb index 9057fde1a..9bbc88c9a 100644 --- a/app/views/legislation/questions/_participation_not_allowed.html.erb +++ b/app/views/legislation/questions/_participation_not_allowed.html.erb @@ -7,14 +7,14 @@ <% elsif user_signed_in? && current_user.unverified? %> <% elsif !user_signed_in? %> <% elsif !@process.debate_phase.open? %>