diff options
Diffstat (limited to 'actionview')
-rw-r--r-- | actionview/lib/action_view/helpers/sanitize_helper/scrubbers.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/actionview/lib/action_view/helpers/sanitize_helper/scrubbers.rb b/actionview/lib/action_view/helpers/sanitize_helper/scrubbers.rb index 1f2df3b108..07611e6927 100644 --- a/actionview/lib/action_view/helpers/sanitize_helper/scrubbers.rb +++ b/actionview/lib/action_view/helpers/sanitize_helper/scrubbers.rb @@ -33,7 +33,9 @@ class PermitScrubber < Loofah::Scrubber def scrub(node) return CONTINUE if skip_node?(node) - return STOP if scrub_node(node) + unless keep_node?(node) + return STOP if scrub_node(node) == STOP + end scrub_attributes(node) end @@ -61,11 +63,8 @@ class PermitScrubber < Loofah::Scrubber end def scrub_node(node) - unless keep_node?(node) - node.before(node.children) # strip - node.remove - true - end + node.before(node.children) # strip + node.remove end def scrub_attributes(node) |