From f292f0971f4d3f02ca2aba4aef46666c27199a40 Mon Sep 17 00:00:00 2001 From: Tadas Tamosauskas Date: Mon, 20 Jun 2011 14:51:07 +0100 Subject: Do not change a frozen text passed to simple_format text helper --- actionpack/lib/action_view/helpers/text_helper.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_view/helpers/text_helper.rb b/actionpack/lib/action_view/helpers/text_helper.rb index 4be95d8f7e..ae71ade588 100644 --- a/actionpack/lib/action_view/helpers/text_helper.rb +++ b/actionpack/lib/action_view/helpers/text_helper.rb @@ -256,6 +256,7 @@ module ActionView # # => "

I'm allowed! It's true.

" def simple_format(text, html_options={}, options={}) text = '' if text.nil? + text = text.dup if text.frozen? start_tag = tag('p', html_options, true) text = sanitize(text) unless options[:sanitize] == false text = text.to_str -- cgit v1.2.3