aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/helpers/sanitize_helper/sanitizers.rb
diff options
context:
space:
mode:
authorTimm <kaspth@gmail.com>2013-07-07 10:35:52 +0200
committerTimm <kaspth@gmail.com>2014-06-15 23:35:25 +0200
commit5dfd394c4da8873d14c2055d06044844eb78ba55 (patch)
treec897978678430779aeb4200a7d42baef8417c9db /actionview/lib/action_view/helpers/sanitize_helper/sanitizers.rb
parent91712cc11ded5c5f042784e098a10e1dca82e0d5 (diff)
downloadrails-5dfd394c4da8873d14c2055d06044844eb78ba55.tar.gz
rails-5dfd394c4da8873d14c2055d06044844eb78ba55.tar.bz2
rails-5dfd394c4da8873d14c2055d06044844eb78ba55.zip
Added guard clauses to FullSanitizer.
Diffstat (limited to 'actionview/lib/action_view/helpers/sanitize_helper/sanitizers.rb')
-rw-r--r--actionview/lib/action_view/helpers/sanitize_helper/sanitizers.rb7
1 files changed, 6 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 335280c718..9d4e5b8e38 100644
--- a/actionview/lib/action_view/helpers/sanitize_helper/sanitizers.rb
+++ b/actionview/lib/action_view/helpers/sanitize_helper/sanitizers.rb
@@ -7,7 +7,12 @@ module ActionView
class FullSanitizer
def sanitize(html, options = {})
- Loofah.fragment(html).text
+ if html
+ return html if html.empty?
+ Loofah.fragment(html).text
+ else
+ nil
+ end
end
end