Skip to content

Commit

Permalink
Do not rely on AV configuration on R5 and up
Browse files Browse the repository at this point in the history
  • Loading branch information
vjt committed Nov 20, 2017
1 parent 21a8c94 commit 17f8474
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/sanitize/rails/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ def configure(config)
# FIXME: Remove this, as it is meant only not to break assumptions on old
# applications.
#
if defined?(::ActionView::Base) &&
require 'rails'

if defined?(::ActionView::Base) && Rails.version.to_i < 5 &&
::ActionView::Base.respond_to?(:sanitized_allowed_tags) &&
::ActionView::Base.sanitized_allowed_tags.respond_to?(:size) &&
::ActionView::Base.sanitized_allowed_tags.size > 0
Expand Down

0 comments on commit 17f8474

Please sign in to comment.