mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Tue Aug 14 11:55:37 2012 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
* lib/cgi/util.rb (CGI::escapeHTML): ' is not recommended. [Bug #6850] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7fc28975bc
commit
745ada8649
3 changed files with 3 additions and 3 deletions
|
@ -22,7 +22,7 @@ class CGI
|
||||||
|
|
||||||
# The set of special characters and their escaped values
|
# The set of special characters and their escaped values
|
||||||
TABLE_FOR_ESCAPE_HTML__ = {
|
TABLE_FOR_ESCAPE_HTML__ = {
|
||||||
"'" => ''',
|
"'" => ''',
|
||||||
'&' => '&',
|
'&' => '&',
|
||||||
'"' => '"',
|
'"' => '"',
|
||||||
'<' => '<',
|
'<' => '<',
|
||||||
|
|
|
@ -54,7 +54,7 @@ class CGIUtilTest < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_cgi_escapeHTML
|
def test_cgi_escapeHTML
|
||||||
assert_equal(CGI::escapeHTML("'&\"><"),"'&"><")
|
assert_equal(CGI::escapeHTML("'&\"><"),"'&"><")
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_cgi_unescapeHTML
|
def test_cgi_unescapeHTML
|
||||||
|
|
|
@ -40,7 +40,7 @@ class TestERB < Test::Unit::TestCase
|
||||||
|
|
||||||
def test_html_escape
|
def test_html_escape
|
||||||
# TODO: ' should be changed to '
|
# TODO: ' should be changed to '
|
||||||
assert_equal(" !"\#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",
|
assert_equal(" !"\#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",
|
||||||
ERB::Util.html_escape(" !\"\#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"))
|
ERB::Util.html_escape(" !\"\#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"))
|
||||||
|
|
||||||
assert_equal("", ERB::Util.html_escape(""))
|
assert_equal("", ERB::Util.html_escape(""))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue