From 7b73913701ff41981d166ca457e41690aac3bce3 Mon Sep 17 00:00:00 2001 From: Sergey Nartimov Date: Mon, 20 Feb 2012 15:41:17 -0800 Subject: fix output safety issue with select options --- actionpack/lib/action_view/helpers/form_options_helper.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'actionpack/lib/action_view') 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 = "\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 = "\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) -- cgit v1.2.3