diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-08-21 22:30:47 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-08-21 22:30:47 +0000 |
commit | bbb6b5e84e53b17c5c08072cae05aed6de6e3abe (patch) | |
tree | 7494530ec476327a21219d980ac33384f0e16753 | |
parent | b0837c440eef2199eb1ef58f92b18cf0b5910d01 (diff) | |
download | ruby-bbb6b5e84e53b17c5c08072cae05aed6de6e3abe.tar.gz |
* lib/cgi/util.rb (CGI.escapeHTML): use '
[ruby-core:47221] [Bug #6861]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/cgi/util.rb | 2 | ||||
-rw-r--r-- | test/cgi/test_cgi_util.rb | 4 | ||||
-rw-r--r-- | test/erb/test_erb.rb | 3 |
4 files changed, 9 insertions, 5 deletions
@@ -1,3 +1,8 @@ +Wed Aug 22 07:27:00 2012 NARUSE, Yui <naruse@ruby-lang.org> + + * lib/cgi/util.rb (CGI.escapeHTML): use ' + [ruby-core:47221] [Bug #6861] + Tue Aug 21 21:59:22 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com> * lib/observer.rb: fix typo. https://github.com/ruby/ruby/pull/162 by diff --git a/lib/cgi/util.rb b/lib/cgi/util.rb index f6c25a9550..41ae724c8c 100644 --- a/lib/cgi/util.rb +++ b/lib/cgi/util.rb @@ -22,7 +22,7 @@ class CGI # The set of special characters and their escaped values TABLE_FOR_ESCAPE_HTML__ = { - "'" => ''', + "'" => ''', '&' => '&', '"' => '"', '<' => '<', diff --git a/test/cgi/test_cgi_util.rb b/test/cgi/test_cgi_util.rb index 5bf5b79988..2c003a0300 100644 --- a/test/cgi/test_cgi_util.rb +++ b/test/cgi/test_cgi_util.rb @@ -54,11 +54,11 @@ class CGIUtilTest < Test::Unit::TestCase end def test_cgi_escapeHTML - assert_equal(CGI::escapeHTML("'&\"><"),"'&"><") + assert_equal(CGI::escapeHTML("'&\"><"),"'&"><") end def test_cgi_unescapeHTML - assert_equal(CGI::unescapeHTML("'&"><"),"'&\"><") + assert_equal(CGI::unescapeHTML("'&"><"),"'&\"><") end end diff --git a/test/erb/test_erb.rb b/test/erb/test_erb.rb index fc1e1fcbc6..7ddbc878d4 100644 --- a/test/erb/test_erb.rb +++ b/test/erb/test_erb.rb @@ -39,8 +39,7 @@ class TestERB < Test::Unit::TestCase end def test_html_escape - # TODO: ' should be changed to ' - assert_equal(" !"\#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~", + assert_equal(" !"\#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~", ERB::Util.html_escape(" !\"\#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~")) assert_equal("", ERB::Util.html_escape("")) |