diff options
author | Timm <kaspth@gmail.com> | 2013-08-09 22:13:05 +0200 |
---|---|---|
committer | Timm <kaspth@gmail.com> | 2014-06-16 21:04:03 +0200 |
commit | 739ecdf753d35ba40e238aedec666bc5eeafb2cc (patch) | |
tree | 459ac47b8d9608628ccd2d9e3cf5485416dd2cca /actionview/lib/action_view | |
parent | d1de087467b1d3a0bc08f6d372db33bf2dcc80d6 (diff) | |
download | rails-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/action_view')
-rw-r--r-- | actionview/lib/action_view/helpers/sanitize_helper/sanitizers.rb | 6 |
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 |