aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib
diff options
context:
space:
mode:
authorTimm <kaspth@gmail.com>2013-08-09 22:13:05 +0200
committerTimm <kaspth@gmail.com>2014-06-16 21:04:03 +0200
commit739ecdf753d35ba40e238aedec666bc5eeafb2cc (patch)
tree459ac47b8d9608628ccd2d9e3cf5485416dd2cca /actionview/lib
parentd1de087467b1d3a0bc08f6d372db33bf2dcc80d6 (diff)
downloadrails-739ecdf753d35ba40e238aedec666bc5eeafb2cc.tar.gz
rails-739ecdf753d35ba40e238aedec666bc5eeafb2cc.tar.bz2
rails-739ecdf753d35ba40e238aedec666bc5eeafb2cc.zip
Changed FullSanitizer sanitize to use tap method instead of temporary variable.
Diffstat (limited to 'actionview/lib')
-rw-r--r--actionview/lib/action_view/helpers/sanitize_helper/sanitizers.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/actionview/lib/action_view/helpers/sanitize_helper/sanitizers.rb b/actionview/lib/action_view/helpers/sanitize_helper/sanitizers.rb
index 3f2cdd53e6..3ba46ccaa9 100644
--- a/actionview/lib/action_view/helpers/sanitize_helper/sanitizers.rb
+++ b/actionview/lib/action_view/helpers/sanitize_helper/sanitizers.rb
@@ -26,9 +26,9 @@ module ActionView
return nil unless html
return html if html.empty?
- fragment = Loofah.fragment(html)
- remove_xpaths(fragment, XPATHS_TO_REMOVE)
- fragment.text
+ Loofah.fragment(html).tap do |fragment|
+ remove_xpaths(fragment, XPATHS_TO_REMOVE)
+ end.text
end
end