Skip to content

Commit

Permalink
Add noopener and noreferer to links in user generated content
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhughes committed Jan 9, 2019
1 parent 1d37d1a commit 5feb6ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config/initializers/sanitize.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Sanitize::Config::OSM = Sanitize::Config::RELAXED.dup

Sanitize::Config::OSM[:elements] -= %w[div style]
Sanitize::Config::OSM[:add_attributes] = { "a" => { "rel" => "nofollow" } }
Sanitize::Config::OSM[:add_attributes] = { "a" => { "rel" => "nofollow noopener noreferer" } }
Sanitize::Config::OSM[:remove_contents] = %w[script style]

0 comments on commit 5feb6ba

Please sign in to comment.