зеркало из https://github.com/github/ruby.git
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:
Родитель
7fc28975bc
Коммит
745ada8649
|
@ -22,7 +22,7 @@ class CGI
|
|||
|
||||
# The set of special characters and their escaped values
|
||||
TABLE_FOR_ESCAPE_HTML__ = {
|
||||
"'" => ''',
|
||||
"'" => ''',
|
||||
'&' => '&',
|
||||
'"' => '"',
|
||||
'<' => '<',
|
||||
|
|
|
@ -54,7 +54,7 @@ class CGIUtilTest < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_cgi_escapeHTML
|
||||
assert_equal(CGI::escapeHTML("'&\"><"),"'&"><")
|
||||
assert_equal(CGI::escapeHTML("'&\"><"),"'&"><")
|
||||
end
|
||||
|
||||
def test_cgi_unescapeHTML
|
||||
|
|
|
@ -40,7 +40,7 @@ class TestERB < Test::Unit::TestCase
|
|||
|
||||
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(""))
|
||||
|
|
Загрузка…
Ссылка в новой задаче