aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view
diff options
context:
space:
mode:
authorTimm <kaspth@gmail.com>2013-08-16 16:49:05 +0200
committerTimm <kaspth@gmail.com>2014-06-16 21:04:07 +0200
commit97c5e6fa027d0ef9151172c193b1f61ee4c4c70a (patch)
tree4bc2fb6763031787f9455948c1a5e2e1003bb80d /actionview/lib/action_view
parent9a3a59eaaefd175379963a3a6048bdb5b3950fb8 (diff)
downloadrails-97c5e6fa027d0ef9151172c193b1f61ee4c4c70a.tar.gz
rails-97c5e6fa027d0ef9151172c193b1f61ee4c4c70a.tar.bz2
rails-97c5e6fa027d0ef9151172c193b1f61ee4c4c70a.zip
Changed: remove_xpaths called with String returns String, while called with Loofah fragment returns Loofah fragment. Added tests for this.
Diffstat (limited to 'actionview/lib/action_view')
-rw-r--r--actionview/lib/action_view/helpers/sanitize_helper/sanitizers.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/actionview/lib/action_view/helpers/sanitize_helper/sanitizers.rb b/actionview/lib/action_view/helpers/sanitize_helper/sanitizers.rb
index c6bbf5e3f7..01ab9830f3 100644
--- a/actionview/lib/action_view/helpers/sanitize_helper/sanitizers.rb
+++ b/actionview/lib/action_view/helpers/sanitize_helper/sanitizers.rb
@@ -14,9 +14,9 @@ module ActionView
def remove_xpaths(html, xpaths)
if html.respond_to?(:xpath)
xpaths.each { |xpath| html.xpath(xpath).remove }
- html.to_s
+ html
else
- remove_xpaths(Loofah.fragment(html), xpaths)
+ remove_xpaths(Loofah.fragment(html), xpaths).to_s
end
end
end