Skip to content

Commit 6cdbf9e

Browse files
authored
Merge pull request #99 from DigitalNZ/tw/site-notice-xss
Updated ruby version and added sanitize blocks
2 parents f56d78a + 185d934 commit 6cdbf9e

5 files changed

Lines changed: 10 additions & 5 deletions

File tree

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0.3
1+
3.1.4

Gemfile.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ GEM
167167
pry-rails (0.3.9)
168168
pry (>= 0.10.4)
169169
public_suffix (5.0.1)
170+
puma (6.6.0)
171+
nio4r (~> 2.0)
170172
racc (1.7.1)
171173
rack (2.2.7)
172174
rack-test (2.1.0)
@@ -273,6 +275,7 @@ GEM
273275

274276
PLATFORMS
275277
arm64-darwin-23
278+
arm64-darwin-24
276279
x86_64-darwin-19
277280
x86_64-darwin-22
278281
x86_64-linux
@@ -283,6 +286,7 @@ DEPENDENCIES
283286
plug!
284287
pry-byebug
285288
pry-rails
289+
puma
286290
rails-controller-testing
287291
rspec-rails
288292
rubocop

app/views/plug/features/index.html.haml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
%tbody
3131
- @features.each do |feature|
3232
%tr
33-
%td= link_to feature.name, edit_feature_path(feature), class: 'strong'
34-
%td= feature.description
33+
%td= link_to sanitize(feature.name), edit_feature_path(feature), class: 'strong'
34+
%td= sanitize(feature.description)
3535
%td= feature.slug
3636
%td{ width: 150, align: 'center' }
3737
- if feature.state == 'enabled'

app/views/plug/site_notices/index.html.haml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
%tbody
2727
- @site_notices.each do |site_notice|
2828
%tr
29-
%td= link_to site_notice.name, edit_site_notice_path(site_notice), class: 'strong'
30-
%td= site_notice.notice.html_safe
29+
%td= link_to sanitize(site_notice.name), edit_site_notice_path(site_notice), class: 'strong'
30+
%td= sanitize(site_notice.notice.html_safe)
3131
%td= site_notice.slug
3232
%td{ width: 150, align: 'center' }
3333
- if site_notice.state == 'enabled'

plug.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Gem::Specification.new do |s|
2525

2626
s.add_development_dependency 'capybara'
2727
s.add_development_dependency 'factory_bot_rails'
28+
s.add_development_dependency 'puma'
2829
s.add_development_dependency 'rails-controller-testing'
2930
s.add_development_dependency 'rspec-rails'
3031
s.add_development_dependency 'selenium-webdriver'

0 commit comments

Comments
 (0)