From 7c988f8030fa5b779041d682c12132ab4da47d1e Mon Sep 17 00:00:00 2001 From: Yoong Kang Lim Date: Wed, 6 May 2015 23:31:49 +1000 Subject: Use ActiveSupport::SafeBuffer when flushing content_for Previously, when content_for is flushed, the content was replaced directly by a new value in ActionView::OutputFlow#set. The problem is this new value passed to the method may not be an instance of ActiveSupport::SafeBuffer. This change forces the value to be set to a new instance of ActiveSupport::SafeBuffer. --- actionview/lib/action_view/flows.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionview/lib') diff --git a/actionview/lib/action_view/flows.rb b/actionview/lib/action_view/flows.rb index ba24510e56..bc61920848 100644 --- a/actionview/lib/action_view/flows.rb +++ b/actionview/lib/action_view/flows.rb @@ -15,7 +15,7 @@ module ActionView # Called by each renderer object to set the layout contents. def set(key, value) - @content[key] = value + @content[key] = ActiveSupport::SafeBuffer.new(value) end # Called by content_for -- cgit v1.2.3