提交 a52e4189 编写于 作者: C Christopher Meiklejohn

Only mark the sliced buffer as safe, if it was safe to begin with.

上级 d12aa483
......@@ -51,8 +51,9 @@ def fragment_for(name = {}, options = nil, &block) #:nodoc:
# This dance is needed because Builder can't use capture
pos = output_buffer.length
yield
output_safe = output_buffer.html_safe?
fragment = output_buffer.slice!(pos..-1)
if output_buffer.kind_of?(ActiveSupport::SafeBuffer)
if output_safe
self.output_buffer = output_buffer.html_safe
end
controller.write_fragment(name, fragment, options)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册