summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/cgi/util.rb2
-rw-r--r--test/cgi/test_cgi_util.rb4
-rw-r--r--version.h2
3 files changed, 6 insertions, 2 deletions
diff --git a/lib/cgi/util.rb b/lib/cgi/util.rb
index 41ae724c8c..0959f0f094 100644
--- a/lib/cgi/util.rb
+++ b/lib/cgi/util.rb
@@ -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 "'"
diff --git a/test/cgi/test_cgi_util.rb b/test/cgi/test_cgi_util.rb
index 2c003a0300..7129cb6c9e 100644
--- a/test/cgi/test_cgi_util.rb
+++ b/test/cgi/test_cgi_util.rb
@@ -61,4 +61,8 @@ class CGIUtilTest < Test::Unit::TestCase
assert_equal(CGI::unescapeHTML("&#39;&amp;&quot;&gt;&lt;"),"'&\"><")
end
+ def test_cgi_unescapeHTML_uppercasecharacter
+ assert_equal(CGI::unescapeHTML("&#x3042;&#x3044;&#X3046;"),"\xE3\x81\x82\xE3\x81\x84\xE3\x81\x86")
+ end
+
end
diff --git a/version.h b/version.h
index f5fb7dc75a..09f0cf0123 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#define RUBY_VERSION "2.0.0"
#define RUBY_RELEASE_DATE "2013-04-16"
-#define RUBY_PATCHLEVEL 140
+#define RUBY_PATCHLEVEL 141
#define RUBY_RELEASE_YEAR 2013
#define RUBY_RELEASE_MONTH 4