Commit de64c68dfcbb494ef36f5a4284be67cf5a1506cf
1 parent
10437855
Exists in
master
and in
1 other branch
Use the 'htmlentities' gem to decode html entities in notice environment info
Showing
3 changed files
with
7 additions
and
3 deletions
Show diff stats
Gemfile
| @@ -5,6 +5,7 @@ gem 'nokogiri' | @@ -5,6 +5,7 @@ gem 'nokogiri' | ||
| 5 | gem 'mongoid', '2.1.2' | 5 | gem 'mongoid', '2.1.2' |
| 6 | gem 'haml' | 6 | gem 'haml' |
| 7 | gem 'will_paginate', '>=3' | 7 | gem 'will_paginate', '>=3' |
| 8 | +gem 'htmlentities', "~> 4.3.0" | ||
| 8 | gem 'devise', '~> 1.4.0' | 9 | gem 'devise', '~> 1.4.0' |
| 9 | gem 'lighthouse-api' | 10 | gem 'lighthouse-api' |
| 10 | gem 'redmine_client', :git => "git://github.com/oruen/redmine_client.git" | 11 | gem 'redmine_client', :git => "git://github.com/oruen/redmine_client.git" |
Gemfile.lock
| @@ -222,6 +222,7 @@ DEPENDENCIES | @@ -222,6 +222,7 @@ DEPENDENCIES | ||
| 222 | factory_girl_rails | 222 | factory_girl_rails |
| 223 | haml | 223 | haml |
| 224 | hoptoad_notifier (~> 2.4) | 224 | hoptoad_notifier (~> 2.4) |
| 225 | + htmlentities (~> 4.3.0) | ||
| 225 | inherited_resources | 226 | inherited_resources |
| 226 | lighthouse-api | 227 | lighthouse-api |
| 227 | mongoid (= 2.1.2) | 228 | mongoid (= 2.1.2) |
app/views/notices/_environment.html.haml
| 1 | .window | 1 | .window |
| 2 | %table.environment | 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 | %tr | 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 | + |