From c2fe0938d7201d4ce0bb2f25e72bf5f70df128af Mon Sep 17 00:00:00 2001 From: Carsten Zimmermann Date: Sat, 13 Dec 2014 22:20:31 +0100 Subject: Re-enable capture'ing non-String values This has been discussed in #17661 and partially reverts the changes made in 9de83050d3a4b260d4aeb5d09ec4eb64f913ba64 and 986cac73e3c56b3dfa22fd1464f6913e38d32cc3 The test case added to content_for acts as a regression / acceptance test. --- actionview/lib/action_view/helpers/capture_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionview/lib/action_view/helpers') diff --git a/actionview/lib/action_view/helpers/capture_helper.rb b/actionview/lib/action_view/helpers/capture_helper.rb index 75d1634b2e..7884e4f1f1 100644 --- a/actionview/lib/action_view/helpers/capture_helper.rb +++ b/actionview/lib/action_view/helpers/capture_helper.rb @@ -36,7 +36,7 @@ module ActionView def capture(*args) value = nil buffer = with_output_buffer { value = yield(*args) } - if string = buffer.presence || value and string.is_a?(String) + if string = buffer.presence || value ERB::Util.html_escape string end end -- cgit v1.2.3