8000 * lib/cgi/util.rb (CGI.escapeHTML): use ' · ruby/ruby@bbb6b5e · GitHub
[go: up one dir, main page]

Skip to content

Commit bbb6b5e

Browse files
committed
* 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
1 parent b0837c4 commit bbb6b5e

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Wed Aug 22 07:27:00 2012 NARUSE, Yui <naruse@ruby-lang.org>
2+
3+
* lib/cgi/util.rb (CGI.escapeHTML): use &#39;
4+
[ruby-core:47221] [Bug #6861]
5+
16
Tue Aug 21 21:59:22 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
27

38
* lib/observer.rb: fix typo. https://github.com/ruby/ruby/pull/162 by

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-
"'" => '&#x27;',
25+
"'" => '&#39;',
2626
'&' => '&amp;',
2727
'"' => '&quot;',
2828
'<' => '&lt;',

test/cgi/test_cgi_util.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ def test_cgi_pretty
5454
end
5555

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

6060
def test_cgi_unescapeHTML
61-
assert_equal(CGI::unescapeHTML("&apos;&amp;&quot;&gt;&lt;"),"'&\"><")
61+
assert_equal(CGI::unescapeHTML("&#39;&amp;&quot;&gt;&lt;"),"'&\"><")
6262
end
6363

6464
end

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;&#x27;()*+,-./0123456789:;&lt;=&gt;?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",
42+
assert_equal(" !&quot;\#$%&amp;&#39;()*+,-./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)
0