Skip to content

Commit

Permalink
Merge pull request #2341 from jyruzicka/update-loofah-methods
Browse files Browse the repository at this point in the history
Use Loofah::HTML5::SafeList where possible
  • Loading branch information
mattr- authored Feb 10, 2020
2 parents 6fd92bb + 7269758 commit 0f113ca
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 0f113ca

Please sign in to comment.