aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/form_options_helper.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-07-22 01:29:18 +0200
committerXavier Noria <fxn@hashref.com>2010-07-22 01:29:18 +0200
commit919eb200a9a0969c444b938d08eb4661d41ba986 (patch)
tree329cbe815d549275cc0dc6aa0f75c18d8954f105 /actionpack/lib/action_view/helpers/form_options_helper.rb
parent56669ec3048de316918ec5ad554fff83d757911b (diff)
parentb456877cfb7e0cb0bab9ffd5674abd23caba0ab4 (diff)
downloadrails-919eb200a9a0969c444b938d08eb4661d41ba986.tar.gz
rails-919eb200a9a0969c444b938d08eb4661d41ba986.tar.bz2
rails-919eb200a9a0969c444b938d08eb4661d41ba986.zip
Merge remote branch 'rails/master'
Diffstat (limited to 'actionpack/lib/action_view/helpers/form_options_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/form_options_helper.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/helpers/form_options_helper.rb b/actionpack/lib/action_view/helpers/form_options_helper.rb
index 6f9d14de8b..ee34452769 100644
--- a/actionpack/lib/action_view/helpers/form_options_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_options_helper.rb
@@ -447,7 +447,7 @@ module ActionView
# wrap the output in an appropriate <tt><select></tt> tag.
def grouped_options_for_select(grouped_options, selected_key = nil, prompt = nil)
body = ''
- body << content_tag(:option, prompt, :value => "") if prompt
+ body << content_tag(:option, prompt, { :value => "" }, true) if prompt
grouped_options = grouped_options.sort if grouped_options.is_a?(Hash)
@@ -593,11 +593,11 @@ module ActionView
private
def add_options(option_tags, options, value = nil)
if options[:include_blank]
- option_tags = "<option value=\"\">#{options[:include_blank] if options[:include_blank].kind_of?(String)}</option>\n" + option_tags
+ option_tags = "<option value=\"\">#{html_escape(options[:include_blank]) if options[:include_blank].kind_of?(String)}</option>\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=\"\">#{prompt}</option>\n" + option_tags
+ option_tags = "<option value=\"\">#{html_escape(prompt)}</option>\n" + option_tags
end
option_tags.html_safe
end