diff options
author | José Valim <jose.valim@gmail.com> | 2011-09-25 04:03:13 -0700 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-09-25 04:03:13 -0700 |
commit | 933ba0cf6e20a5fac72ece21e5b51fbe485b3d90 (patch) | |
tree | a2ea6a2a140285da809ad9815c6f47df8649b98e | |
parent | ef4d1cebbc0cb4db59cdfca16d74bbf0f68a58f1 (diff) | |
parent | 5ffa69793fd3e1d4af41ebc719a6736163eb7433 (diff) | |
download | rails-933ba0cf6e20a5fac72ece21e5b51fbe485b3d90.tar.gz rails-933ba0cf6e20a5fac72ece21e5b51fbe485b3d90.tar.bz2 rails-933ba0cf6e20a5fac72ece21e5b51fbe485b3d90.zip |
Merge pull request #3124 from avakhov/patch-6-stylesheet-link
escape options for the stylesheet_link_tag method
-rw-r--r-- | actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb | 2 | ||||
-rw-r--r-- | actionpack/test/template/asset_tag_helper_test.rb | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb b/actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb index 2eb3eb31af..343153c8c5 100644 --- a/actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb +++ b/actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb @@ -17,7 +17,7 @@ module ActionView def asset_tag(source, options) # We force the :request protocol here to avoid a double-download bug in IE7 and IE8 - tag("link", { "rel" => "stylesheet", "type" => Mime::CSS, "media" => "screen", "href" => ERB::Util.html_escape(path_to_asset(source, :protocol => :request)) }.merge(options), false, false) + tag("link", { "rel" => "stylesheet", "type" => Mime::CSS, "media" => "screen", "href" => path_to_asset(source, :protocol => :request) }.merge(options)) end def custom_dir diff --git a/actionpack/test/template/asset_tag_helper_test.rb b/actionpack/test/template/asset_tag_helper_test.rb index d93433deac..aa7304b3ed 100644 --- a/actionpack/test/template/asset_tag_helper_test.rb +++ b/actionpack/test/template/asset_tag_helper_test.rb @@ -366,6 +366,10 @@ class AssetTagHelperTest < ActionView::TestCase assert stylesheet_link_tag('dir/other/file', 'dir/file2').html_safe? end + def test_stylesheet_link_tag_escapes_options + assert_dom_equal %(<link href="/file.css" media="<script>" rel="stylesheet" type="text/css" />), stylesheet_link_tag('/file', :media => '<script>') + end + def test_custom_stylesheet_expansions ENV["RAILS_ASSET_ID"] = '' ActionView::Helpers::AssetTagHelper::register_stylesheet_expansion :robbery => ["bank", "robber"] |