diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2010-03-08 19:55:57 -0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-03-16 11:10:31 +0100 |
commit | e13c179499f227071cbe829221877e1c0d03c0b1 (patch) | |
tree | 926f4582639f340a3983459206a2bf69dcbc5d6b /actionpack/lib | |
parent | 0f504a5646ba9eaf4c6a439075f0cf76e45257dc (diff) | |
download | rails-e13c179499f227071cbe829221877e1c0d03c0b1.tar.gz rails-e13c179499f227071cbe829221877e1c0d03c0b1.tar.bz2 rails-e13c179499f227071cbe829221877e1c0d03c0b1.zip |
Change array entries to safe doesn't worth then the array is joined as a string losing the safe property of his entries [#4134 status:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/helpers/translation_helper.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/translation_helper.rb b/actionpack/lib/action_view/helpers/translation_helper.rb index 8a89ee58a0..f996762d6f 100644 --- a/actionpack/lib/action_view/helpers/translation_helper.rb +++ b/actionpack/lib/action_view/helpers/translation_helper.rb @@ -13,7 +13,7 @@ module ActionView def translate(key, options = {}) options[:raise] = true translation = I18n.translate(scope_key_by_partial(key), options) - translation.is_a?(Array) ? translation.map { |entry| entry.html_safe } : translation.html_safe + translation.respond_to?(:html_safe) ? translation.html_safe : translation rescue I18n::MissingTranslationData => e keys = I18n.normalize_keys(e.locale, e.key, e.options[:scope]) content_tag('span', keys.join(', '), :class => 'translation_missing') |