diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG index 08e945fdb8..c7cd0efd4b 100644 --- a/actionpack/CHANGELOG +++ b/actionpack/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Fix HTML::Node to output double quotes instead of single quotes. Closes #6845 [mitreandy] + * Correctly report which filter halted the chain. #6699 [Martin Emde] * Fix a bug in Routing where a parameter taken from the path of the current request could not be used as a query parameter for the next. Closes #6752. [Nicholas Seckar] diff --git a/actionpack/lib/action_controller/vendor/html-scanner/html/node.rb b/actionpack/lib/action_controller/vendor/html-scanner/html/node.rb index a6490b1f3b..9b7621820e 100644 --- a/actionpack/lib/action_controller/vendor/html-scanner/html/node.rb +++ b/actionpack/lib/action_controller/vendor/html-scanner/html/node.rb @@ -316,7 +316,7 @@ module HTML #:nodoc: s = "<#{@name}" @attributes.each do |k,v| s << " #{k}" - s << "='#{v.gsub(/'/,"\\\\'")}'" if String === v + s << "=\"#{v}\"" if String === v end s << " /" if @closing == :self s << ">" diff --git a/actionpack/test/template/text_helper_test.rb b/actionpack/test/template/text_helper_test.rb index 37eff78e76..49f5160711 100644 --- a/actionpack/test/template/text_helper_test.rb +++ b/actionpack/test/template/text_helper_test.rb @@ -204,7 +204,7 @@ class TextHelperTest < Test::Unit::TestCase def test_sanitize_form raw = "
" result = sanitize(raw) - assert_equal "<form action='/foo/bar' method='post'></form>", result + assert_equal %(<form action="/foo/bar" method="post"></form>), result end def test_sanitize_plaintext @@ -216,25 +216,25 @@ class TextHelperTest < Test::Unit::TestCase def test_sanitize_script raw = "" result = sanitize(raw) - assert_equal "<script language='Javascript'>blah blah blah</script>", result + assert_equal %{<script language="Javascript">blah blah blah</script>}, result end def test_sanitize_js_handlers raw = %{onthis="do that" hello} result = sanitize(raw) - assert_equal %{onthis="do that" hello}, result + assert_equal %{onthis="do that" hello}, result end def test_sanitize_javascript_href raw = %{href="javascript:bang" foo, bar} result = sanitize(raw) - assert_equal %{href="javascript:bang" foo, bar}, result + assert_equal %{href="javascript:bang" foo, bar}, result end def test_sanitize_image_src raw = %{src="javascript:bang"