From b0defa4721539f2992bdfb9ce1ddf82318bad186 Mon Sep 17 00:00:00 2001 From: thedarkside Date: Tue, 26 Mar 2019 16:21:39 +0100 Subject: [PATCH] Ensure rendered html content gets allways marked as html_safe --- lib/action_controller/caching/actions.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/action_controller/caching/actions.rb b/lib/action_controller/caching/actions.rb index 8c0ee84..e68c712 100644 --- a/lib/action_controller/caching/actions.rb +++ b/lib/action_controller/caching/actions.rb @@ -165,7 +165,7 @@ def around(controller) body = controller._save_fragment(cache_path.path, @store_options) end - body = render_to_string(controller, body) unless cache_layout + body = render_to_string(controller, body.respond_to?(:html_safe) ? body.html_safe : body) unless cache_layout controller.response_body = body controller.content_type = Mime[cache_path.extension || :html]