mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
b0837c440e
commit
bbb6b5e84e
4 changed files with 9 additions and 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
|
||||
|
|
|
@ -22,7 +22,7 @@ class CGI
|
|||
|
||||
# The set of special characters and their escaped values
|
||||
TABLE_FOR_ESCAPE_HTML__ = {
|
||||
"'" => ''',
|
||||
"'" => ''',
|
||||
'&' => '&',
|
||||
'"' => '"',
|
||||
'<' => '<',
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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(""))
|
||||
|
|
Loading…
Reference in a new issue