Skip to content

Commit 538bd3c

Browse files
committed
1 parent 4e75451 commit 538bd3c

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

lib/cgi/util.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def CGI::unescape(string,encoding=@@accept_charset)
2222

2323
# The set of special characters and their escaped values
2424
TABLE_FOR_ESCAPE_HTML__ = {
25-
"'" => ''',
25+
"'" => ''',
2626
'&' => '&',
2727
'"' => '"',
2828
'<' => '&lt;',

test/cgi/test_cgi_util.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def test_cgi_pretty
5454
end
5555

5656
def test_cgi_escapeHTML
57-
assert_equal(CGI::escapeHTML("'&\"><"),"&apos;&amp;&quot;&gt;&lt;")
57+
assert_equal(CGI::escapeHTML("'&\"><"),"&#x27;&amp;&quot;&gt;&lt;")
5858
end
5959

6060
def test_cgi_unescapeHTML

test/erb/test_erb.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ def test_with_filename_and_safe_level
3939
end
4040

4141
def test_html_escape
42-
# TODO: &apos; should be changed to &#x27;
43-
assert_equal(" !&quot;\#$%&amp;&apos;()*+,-./0123456789:;&lt;=&gt;?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",
42+
assert_equal(" !&quot;\#$%&amp;&#x27;()*+,-./0123456789:;&lt;=&gt;?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",
4443
ERB::Util.html_escape(" !\"\#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"))
4544

4645
assert_equal("", ERB::Util.html_escape(""))

0 commit comments

Comments
 (0)