aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-03-01 09:51:51 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2012-03-01 09:51:51 -0800
commitc2897901de4266e5c02da6cc5a9348bfde13552e (patch)
tree6efe811c1c6e074fcac0daae63b9d9bf7634e995 /actionpack/lib/action_view
parent5bb5780f7b2015f3f948f39e0151198591757056 (diff)
parent01b470f526922ad3fc5562a237d11d45347befa9 (diff)
downloadrails-c2897901de4266e5c02da6cc5a9348bfde13552e.tar.gz
rails-c2897901de4266e5c02da6cc5a9348bfde13552e.tar.bz2
rails-c2897901de4266e5c02da6cc5a9348bfde13552e.zip
Merge branch '3-2-2' into 3-2-stable
* 3-2-2: bumping to 3.2.2 Ensure [] respects the status of the buffer. Merge pull request #4834 from sskirby/fix_usage_of_psql_in_db_test_prepare Merge pull request #5084 from johndouthat/patch-1 updating RAILS_VERSION delete vulnerable AS::SafeBuffer#[] use AS::SafeBuffer#clone_empty for flushing the output_buffer add AS::SafeBuffer#clone_empty fix output safety issue with select options
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r--actionpack/lib/action_view/helpers/capture_helper.rb2
-rw-r--r--actionpack/lib/action_view/helpers/form_options_helper.rb6
2 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/action_view/helpers/capture_helper.rb b/actionpack/lib/action_view/helpers/capture_helper.rb
index 8abd85c3a3..370bbaf623 100644
--- a/actionpack/lib/action_view/helpers/capture_helper.rb
+++ b/actionpack/lib/action_view/helpers/capture_helper.rb
@@ -194,7 +194,7 @@ module ActionView
def flush_output_buffer #:nodoc:
if output_buffer && !output_buffer.empty?
response.body_parts << output_buffer
- self.output_buffer = output_buffer[0,0]
+ self.output_buffer = output_buffer.respond_to?(:clone_empty) ? output_buffer.clone_empty : output_buffer[0, 0]
nil
end
end
diff --git a/actionpack/lib/action_view/helpers/form_options_helper.rb b/actionpack/lib/action_view/helpers/form_options_helper.rb
index e00ac8f3f2..f64d3907a2 100644
--- a/actionpack/lib/action_view/helpers/form_options_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_options_helper.rb
@@ -616,13 +616,13 @@ module ActionView
private
def add_options(option_tags, options, value = nil)
if options[:include_blank]
- option_tags = "<option value=\"\">#{ERB::Util.html_escape(options[:include_blank]) if options[:include_blank].kind_of?(String)}</option>\n" + option_tags
+ option_tags = content_tag('option', options[:include_blank].kind_of?(String) ? options[:include_blank] : nil, :value => '') + "\n" + option_tags
end
if value.blank? && options[:prompt]
prompt = options[:prompt].kind_of?(String) ? options[:prompt] : I18n.translate('helpers.select.prompt', :default => 'Please select')
- option_tags = "<option value=\"\">#{ERB::Util.html_escape(prompt)}</option>\n" + option_tags
+ option_tags = content_tag('option', prompt, :value => '') + "\n" + option_tags
end
- option_tags.html_safe
+ option_tags
end
def select_content_tag(option_tags, options, html_options)