From c4abe8eb2826d39f98e898f48659df336438f802 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Wed, 22 Jul 2020 20:57:16 +0100 Subject: [PATCH] Fix the CrossSiteScripting warnings from Brakeman --- app/views/users/_terms.html.erb | 36 ++++++++++++++++----------------- config/brakeman.yml | 1 - lib/osm.rb | 2 +- 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/app/views/users/_terms.html.erb b/app/views/users/_terms.html.erb index f01b3bfb7..6a70a88f1 100644 --- a/app/views/users/_terms.html.erb +++ b/app/views/users/_terms.html.erb @@ -1,45 +1,45 @@

- <%= raw @text["intro"] %> - <%= raw @text["next_with_decline"] %> + <%= @text["intro"] %> + <%= @text["next_with_decline"] %>

-

<%= raw @text["introduction"] %>

+

<%= @text["introduction"] %>

  1. -

    <%= raw @text["section_1"] %>

    +

    <%= @text["section_1"] %>

    <% unless @text['section_1a'].nil? %>
      -
    1. <%= raw @text["section_1a"] %>
    2. -
    3. <%= raw @text["section_1b"] %>
    4. +
    5. <%= @text["section_1a"] %>
    6. +
    7. <%= @text["section_1b"] %>
    <% end %>
-

<%= raw @text["rights_granted"] %>

+

<%= @text["rights_granted"] %>

  1. -

    <%= raw @text["section_2"] %>

    +

    <%= @text["section_2"] %>

  2. -

    <%= raw @text["section_3"] %>

    -

    <%= raw @text["active_defn_1"] %>

    -

    <%= raw @text["active_defn_2"] %>

    +

    <%= @text["section_3"] %>

    +

    <%= @text["active_defn_1"] %>

    +

    <%= @text["active_defn_2"] %>

  3. -

    <%= raw @text["section_4"] %>

    +

    <%= @text["section_4"] %>

  4. -

    <%= raw @text["section_5"] %>

    +

    <%= @text["section_5"] %>

-

<%= raw @text["limitation_of_liability"] %>

+

<%= @text["limitation_of_liability"] %>

    -
  1. <%= raw @text["section_6"] %>

  2. -
  3. <%= raw @text["section_7"] %>

  4. +
  5. <%= @text["section_6"] %>

  6. +
  7. <%= @text["section_7"] %>

-

<%= raw @text["miscellaneous"] %>

+

<%= @text["miscellaneous"] %>

  1. -

    <%= raw @text["section_8"] %>

    +

    <%= @text["section_8"] %>

diff --git a/config/brakeman.yml b/config/brakeman.yml index f8fab871e..3551b75e4 100644 --- a/config/brakeman.yml +++ b/config/brakeman.yml @@ -1,6 +1,5 @@ :skip_checks: # These checks are skipped, but should be considered TODO -- CheckCrossSiteScripting - CheckExecute - CheckFileAccess - CheckRedirect diff --git a/lib/osm.rb b/lib/osm.rb index 3e4b5dcee..1d3700cd9 100644 --- a/lib/osm.rb +++ b/lib/osm.rb @@ -560,7 +560,7 @@ module OSM def self.legal_text_for_country(country_code) file_name = Rails.root.join("config", "legales", country_code.to_s + ".yml") file_name = Rails.root.join("config", "legales", Settings.default_legale + ".yml") unless File.exist? file_name - YAML.load_file(file_name) + YAML.load_file(file_name).transform_values!(&:html_safe) end # Return the HTTP client to use -- 2.43.2