Skip to content

Commit

Permalink
Only call deprecate_constant if available
Browse files Browse the repository at this point in the history
  • Loading branch information
Juanito Fatas committed Apr 1, 2019
1 parent 366d010 commit c9c4124
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/loofah/helpers.rb
Expand Up @@ -95,7 +95,9 @@ def sanitize_css style_string, *args
end

WhiteListSanitizer = SafeListSanitizer
deprecate_constant :WhiteListSanitizer
if Object.respond_to?(:deprecate_constant)
deprecate_constant :WhiteListSanitizer
end
end
end
end
4 changes: 3 additions & 1 deletion lib/loofah/html5/safelist.rb
Expand Up @@ -787,7 +787,9 @@ module SafeList
end

WhiteList = SafeList
deprecate_constant :WhiteList
if Object.respond_to?(:deprecate_constant)
deprecate_constant :WhiteList
end

::Loofah::MetaHelpers.add_downcased_set_members_to_all_set_constants ::Loofah::HTML5::SafeList
end
Expand Down

0 comments on commit c9c4124

Please sign in to comment.