Skip to content

Commit 0f113ca

Browse files
authored
Merge pull request #2341 from jyruzicka/update-loofah-methods
Use Loofah::HTML5::SafeList where possible
2 parents 6fd92bb + 7269758 commit 0f113ca

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

config/initializers/sanitizer.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
1-
Loofah::HTML5::WhiteList::ALLOWED_PROTOCOLS.merge(%w(message onenote))
1+
# From Loofah 2.3.0, we should use Loofah::HTML5::SafeList over
2+
# Loofah::HTML5::WhiteList
3+
safe_list =
4+
if Loofah::HTML5.constants.include?(:SafeList)
5+
Loofah::HTML5::SafeList
6+
else
7+
Loofah::HTML5::WhiteList
8+
end
9+
10+
safe_list::ALLOWED_PROTOCOLS.merge(%w(message onenote))

0 commit comments

Comments
 (0)