From f428aeaa197aa5ec686d2f7103c0aadc883774d2 Mon Sep 17 00:00:00 2001 From: Timm Date: Fri, 9 Aug 2013 18:12:25 +0200 Subject: Changed explanation for no duck typing of custom scrubbers. --- actionview/lib/action_view/helpers/sanitize_helper/sanitizers.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/actionview/lib/action_view/helpers/sanitize_helper/sanitizers.rb b/actionview/lib/action_view/helpers/sanitize_helper/sanitizers.rb index c014219485..99d4e64346 100644 --- a/actionview/lib/action_view/helpers/sanitize_helper/sanitizers.rb +++ b/actionview/lib/action_view/helpers/sanitize_helper/sanitizers.rb @@ -57,7 +57,8 @@ module ActionView return nil unless html loofah_fragment = Loofah.fragment(html) - if scrubber = options[:scrubber] # Loofah makes sure this is a scrubber + if scrubber = options[:scrubber] + # No duck typing, Loofah ensures subclass of Loofah::Scrubber loofah_fragment.scrub!(scrubber) elsif options[:tags] || options[:attributes] @permit_scrubber.tags = options[:tags] -- cgit v1.2.3