Skip to content

Commit

Permalink
Use Loofah::HTML5::SafeList where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
jyruzicka committed Feb 8, 2020
1 parent 6fcf7e6 commit 7269758
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion config/initializers/sanitizer.rb
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
Loofah::HTML5::WhiteList::ALLOWED_PROTOCOLS.merge(%w(message onenote))
# From Loofah 2.3.0, we should use Loofah::HTML5::SafeList over
# Loofah::HTML5::WhiteList
safe_list =
if Loofah::HTML5.constants.include?(:SafeList)
Loofah::HTML5::SafeList
else
Loofah::HTML5::WhiteList
end

safe_list::ALLOWED_PROTOCOLS.merge(%w(message onenote))

0 comments on commit 7269758

Please sign in to comment.