diff options
author | Timm <kaspth@gmail.com> | 2013-09-13 15:52:39 +0200 |
---|---|---|
committer | Timm <kaspth@gmail.com> | 2014-06-16 21:04:13 +0200 |
commit | 0a0d151bb8dd9c4a04befbaa302471860a530a94 (patch) | |
tree | e462fd0cffa5e3979844a48512bee320d90e3dcf /actionview/lib/action_view/helpers/sanitize_helper/sanitizers.rb | |
parent | 5430487d85de3e6ac0d886e384ef039f15e64a88 (diff) | |
download | rails-0a0d151bb8dd9c4a04befbaa302471860a530a94.tar.gz rails-0a0d151bb8dd9c4a04befbaa302471860a530a94.tar.bz2 rails-0a0d151bb8dd9c4a04befbaa302471860a530a94.zip |
Now returning html if html is blank? in FullSanitizer and WhiteListSanitizer. This means it'll return false if called with false, however that is not a valid use case.
Diffstat (limited to 'actionview/lib/action_view/helpers/sanitize_helper/sanitizers.rb')
-rw-r--r-- | actionview/lib/action_view/helpers/sanitize_helper/sanitizers.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/actionview/lib/action_view/helpers/sanitize_helper/sanitizers.rb b/actionview/lib/action_view/helpers/sanitize_helper/sanitizers.rb index f6c13885ff..251820b81b 100644 --- a/actionview/lib/action_view/helpers/sanitize_helper/sanitizers.rb +++ b/actionview/lib/action_view/helpers/sanitize_helper/sanitizers.rb @@ -1,4 +1,5 @@ require 'active_support/core_ext/class/attribute' +require 'active_support/core_ext/object/blank' require 'active_support/deprecation' require 'action_view/helpers/sanitize_helper/scrubbers' @@ -25,7 +26,7 @@ module ActionView class FullSanitizer < Sanitizer def sanitize(html, options = {}) return unless html - return html if html.empty? + return html if html.blank? Loofah.fragment(html).tap do |fragment| remove_xpaths(fragment, XPATHS_TO_REMOVE) @@ -51,6 +52,7 @@ module ActionView def sanitize(html, options = {}) return unless html + return html if html.blank? loofah_fragment = Loofah.fragment(html) |