diff options
author | Sergey Nartimov <just.lest@gmail.com> | 2012-02-20 15:19:28 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-02-20 15:19:28 -0800 |
commit | 08b029cd245a304fd204081c1c7f2a96ce32f4c6 (patch) | |
tree | a6e9c4ff940848d4152b66d9a482e0f5a0aa91cb /actionpack/lib/action_view/helpers | |
parent | 563df87f19d21eb491f1c24dab0f59682fe0a737 (diff) | |
download | rails-08b029cd245a304fd204081c1c7f2a96ce32f4c6.tar.gz rails-08b029cd245a304fd204081c1c7f2a96ce32f4c6.tar.bz2 rails-08b029cd245a304fd204081c1c7f2a96ce32f4c6.zip |
fix output safety issue with select options
Diffstat (limited to 'actionpack/lib/action_view/helpers')
-rw-r--r-- | actionpack/lib/action_view/helpers/tags/base.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/helpers/tags/base.rb b/actionpack/lib/action_view/helpers/tags/base.rb index 1ece0ad2fc..b3105ade62 100644 --- a/actionpack/lib/action_view/helpers/tags/base.rb +++ b/actionpack/lib/action_view/helpers/tags/base.rb @@ -133,13 +133,13 @@ module ActionView 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 end end |