Commit de64c68dfcbb494ef36f5a4284be67cf5a1506cf

Authored by Nathan Broadbent
1 parent 10437855
Exists in master and in 1 other branch production

Use the 'htmlentities' gem to decode html entities in notice environment info

Gemfile
... ... @@ -5,6 +5,7 @@ gem 'nokogiri'
5 5 gem 'mongoid', '2.1.2'
6 6 gem 'haml'
7 7 gem 'will_paginate', '>=3'
  8 +gem 'htmlentities', "~> 4.3.0"
8 9 gem 'devise', '~> 1.4.0'
9 10 gem 'lighthouse-api'
10 11 gem 'redmine_client', :git => "git://github.com/oruen/redmine_client.git"
... ...
Gemfile.lock
... ... @@ -222,6 +222,7 @@ DEPENDENCIES
222 222 factory_girl_rails
223 223 haml
224 224 hoptoad_notifier (~> 2.4)
  225 + htmlentities (~> 4.3.0)
225 226 inherited_resources
226 227 lighthouse-api
227 228 mongoid (= 2.1.2)
... ...
app/views/notices/_environment.html.haml
1 1 .window
2 2 %table.environment
3   - - notice.env_vars.sort_by {|pair| pair[0]}.each do |pair|
  3 + - html_entities = HTMLEntities.new
  4 + - notice.env_vars.sort_by {|pair| pair[0]}.each do |key, value|
4 5 %tr
5   - %th= pair[0]
6   - %td.main= pair[1]
  6 + %th= h(html_entities.decode(key))
  7 + %td.main= h(html_entities.decode(value))
  8 +
... ...