aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionpack/CHANGELOG2
-rw-r--r--actionpack/lib/action_controller/vendor/html-scanner/html/node.rb2
-rw-r--r--actionpack/test/template/text_helper_test.rb10
3 files changed, 8 insertions, 6 deletions
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 = "<form action=\"/foo/bar\" method=\"post\"><input></form>"
result = sanitize(raw)
- assert_equal "&lt;form action='/foo/bar' method='post'><input>&lt;/form>", result
+ assert_equal %(&lt;form action="/foo/bar" method="post"><input>&lt;/form>), result
end
def test_sanitize_plaintext
@@ -216,25 +216,25 @@ class TextHelperTest < Test::Unit::TestCase
def test_sanitize_script
raw = "<script language=\"Javascript\">blah blah blah</script>"
result = sanitize(raw)
- assert_equal "&lt;script language='Javascript'>blah blah blah&lt;/script>", result
+ assert_equal %{&lt;script language="Javascript">blah blah blah&lt;/script>}, result
end
def test_sanitize_js_handlers
raw = %{onthis="do that" <a href="#" onclick="hello" name="foo" onbogus="remove me">hello</a>}
result = sanitize(raw)
- assert_equal %{onthis="do that" <a name='foo' href='#'>hello</a>}, result
+ assert_equal %{onthis="do that" <a name="foo" href="#">hello</a>}, result
end
def test_sanitize_javascript_href
raw = %{href="javascript:bang" <a href="javascript:bang" name="hello">foo</a>, <span href="javascript:bang">bar</span>}
result = sanitize(raw)
- assert_equal %{href="javascript:bang" <a name='hello'>foo</a>, <span>bar</span>}, result
+ assert_equal %{href="javascript:bang" <a name="hello">foo</a>, <span>bar</span>}, result
end
def test_sanitize_image_src
raw = %{src="javascript:bang" <img src="javascript:bang" width="5">foo</img>, <span src="javascript:bang">bar</span>}
result = sanitize(raw)
- assert_equal %{src="javascript:bang" <img width='5'>foo</img>, <span>bar</span>}, result
+ assert_equal %{src="javascript:bang" <img width="5">foo</img>, <span>bar</span>}, result
end
def test_cycle_class