Skip to content

Commit

Permalink
Fix that captured content (e.g. with form_for or div_for) would be HT…
Browse files Browse the repository at this point in the history
…ML-escaped even without the rails_xss plugin installed. Rails 2.3.7, we barely knew ya...
  • Loading branch information
jeremy committed May 24, 2010
1 parent f97da34 commit c66013e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion actionpack/lib/action_view/helpers/capture_helper.rb
Expand Up @@ -124,7 +124,7 @@ def content_for(name, content = nil, &block)

# Use an alternate output buffer for the duration of the block.
# Defaults to a new empty string.
def with_output_buffer(buf = ActiveSupport::SafeBuffer.new) #:nodoc:
def with_output_buffer(buf = '') #:nodoc:
self.output_buffer, old_buffer = buf, output_buffer
yield
output_buffer
Expand Down
2 changes: 1 addition & 1 deletion actionpack/lib/action_view/test_case.rb
Expand Up @@ -53,7 +53,7 @@ def initialize
setup :setup_with_controller
def setup_with_controller
@controller = TestController.new
@output_buffer = ''.html_safe
@output_buffer = ''
@rendered = ''

self.class.send(:include_helper_modules!)
Expand Down
2 changes: 1 addition & 1 deletion actionpack/test/controller/capture_test.rb
Expand Up @@ -36,7 +36,7 @@ def setup

def test_simple_capture
get :capturing
assert_equal "Dreamy days", @response.body.strip
assert_equal "<p>Dreamy days</p>", @response.body.strip
end

def test_content_for
Expand Down
4 changes: 2 additions & 2 deletions actionpack/test/fixtures/test/capturing.erb
@@ -1,4 +1,4 @@
<% days = capture do %>
Dreamy days
<p>Dreamy days</p>
<% end %>
<%= days %>
<%= days %>

0 comments on commit c66013e

Please sign in to comment.