mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/cgi/util.rb (CGI::unescapeHTML): fix Hexadecimal numeric character.
[Bug #8183] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a48f99ce5c
commit
5865e7604c
2 changed files with 5 additions and 1 deletions
|
@ -55,7 +55,7 @@ class CGI
|
|||
end
|
||||
end
|
||||
asciicompat = Encoding.compatible?(string, "a")
|
||||
string.gsub(/&(apos|amp|quot|gt|lt|\#[0-9]+|\#x[0-9A-Fa-f]+);/) do
|
||||
string.gsub(/&(apos|amp|quot|gt|lt|\#[0-9]+|\#[xX][0-9A-Fa-f]+);/) do
|
||||
match = $1.dup
|
||||
case match
|
||||
when 'apos' then "'"
|
||||
|
|
|
@ -61,4 +61,8 @@ class CGIUtilTest < Test::Unit::TestCase
|
|||
assert_equal(CGI::unescapeHTML("'&"><"),"'&\"><")
|
||||
end
|
||||
|
||||
def test_cgi_unescapeHTML_uppercasecharacter
|
||||
assert_equal(CGI::unescapeHTML("あいう"),"\xE3\x81\x82\xE3\x81\x84\xE3\x81\x86")
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue