diff options
author | Timm <kaspth@gmail.com> | 2013-07-07 10:35:52 +0200 |
---|---|---|
committer | Timm <kaspth@gmail.com> | 2014-06-15 23:35:25 +0200 |
commit | 5dfd394c4da8873d14c2055d06044844eb78ba55 (patch) | |
tree | c897978678430779aeb4200a7d42baef8417c9db /actionview/lib/action_view/helpers | |
parent | 91712cc11ded5c5f042784e098a10e1dca82e0d5 (diff) | |
download | rails-5dfd394c4da8873d14c2055d06044844eb78ba55.tar.gz rails-5dfd394c4da8873d14c2055d06044844eb78ba55.tar.bz2 rails-5dfd394c4da8873d14c2055d06044844eb78ba55.zip |
Added guard clauses to FullSanitizer.
Diffstat (limited to 'actionview/lib/action_view/helpers')
-rw-r--r-- | actionview/lib/action_view/helpers/sanitize_helper/sanitizers.rb | 7 |
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 |