From 5dfd394c4da8873d14c2055d06044844eb78ba55 Mon Sep 17 00:00:00 2001 From: Timm Date: Sun, 7 Jul 2013 10:35:52 +0200 Subject: Added guard clauses to FullSanitizer. --- actionview/lib/action_view/helpers/sanitize_helper/sanitizers.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'actionview/lib/action_view/helpers') 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 -- cgit v1.2.3