From b387d9a14aeecc372f49544d927b2f24d5a39d49 Mon Sep 17 00:00:00 2001 From: Vipul A M Date: Wed, 20 Jan 2016 12:25:06 +0530 Subject: html_safe is not supposed to be public API for AV. This change removes usage of html_safe in favour of raw() in AV helpers. Also changed usage of html_safe to make use of raw() instead so that the intended behaviour is verified with raw() --- actionview/lib/action_view/helpers/form_helper.rb | 4 ++-- actionview/lib/action_view/helpers/form_tag_helper.rb | 12 ++++++------ actionview/lib/action_view/helpers/output_safety_helper.rb | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'actionview/lib/action_view') diff --git a/actionview/lib/action_view/helpers/form_helper.rb b/actionview/lib/action_view/helpers/form_helper.rb index b43d99ebb7..c1015ffe89 100644 --- a/actionview/lib/action_view/helpers/form_helper.rb +++ b/actionview/lib/action_view/helpers/form_helper.rb @@ -765,7 +765,7 @@ module ActionView # # => # # label(:post, :terms) do - # 'Accept Terms.'.html_safe + # raw('Accept Terms.') # end # # => def label(object_name, method, content_or_options = nil, options = nil, &block) @@ -1675,7 +1675,7 @@ module ActionView # # => # # label(:terms) do - # 'Accept Terms.'.html_safe + # raw('Accept Terms.') # end # # => def label(method, text = nil, options = {}, &block) diff --git a/actionview/lib/action_view/helpers/form_tag_helper.rb b/actionview/lib/action_view/helpers/form_tag_helper.rb index d521553481..55dac74d00 100644 --- a/actionview/lib/action_view/helpers/form_tag_helper.rb +++ b/actionview/lib/action_view/helpers/form_tag_helper.rb @@ -93,22 +93,22 @@ module ActionView # select_tag "people", options_from_collection_for_select(@people, "id", "name", "1") # # # - # select_tag "people", "".html_safe + # select_tag "people", raw("") # # => # - # select_tag "count", "".html_safe + # select_tag "count", raw("") # # => # - # select_tag "colors", "".html_safe, multiple: true + # select_tag "colors", raw(""), multiple: true # # => # - # select_tag "locations", "".html_safe + # select_tag "locations", raw("") # # => # - # select_tag "access", "".html_safe, multiple: true, class: 'form_input', id: 'unique_id' + # select_tag "access", raw(""), multiple: true, class: 'form_input', id: 'unique_id' # # => # @@ -121,7 +121,7 @@ module ActionView # select_tag "people", options_from_collection_for_select(@people, "id", "name"), prompt: "Select something" # # => # - # select_tag "destination", "".html_safe, disabled: true + # select_tag "destination", raw(""), disabled: true # # => # diff --git a/actionview/lib/action_view/helpers/output_safety_helper.rb b/actionview/lib/action_view/helpers/output_safety_helper.rb index 1c2a400245..c0fc3b820f 100644 --- a/actionview/lib/action_view/helpers/output_safety_helper.rb +++ b/actionview/lib/action_view/helpers/output_safety_helper.rb @@ -22,10 +22,10 @@ module ActionView #:nodoc: # the supplied separator, are HTML escaped unless they are HTML # safe, and the returned string is marked as HTML safe. # - # safe_join(["

foo

".html_safe, "

bar

"], "
") + # safe_join([raw("

foo

"), "

bar

"], "
") # # => "

foo

<br /><p>bar</p>" # - # safe_join(["

foo

".html_safe, "

bar

".html_safe], "
".html_safe) + # safe_join([raw("

foo

"), raw("

bar

")], raw("
") # # => "

foo


bar

" # def safe_join(array, sep=$,) -- cgit v1.2.3