From b253fdb93db3c2157a6a147e0b621548fc7aad1a Mon Sep 17 00:00:00 2001 From: mame Date: Thu, 18 Sep 2008 11:05:09 +0000 Subject: * lib/uri/common.rb (unescape): skip '%' to make String#hex work correctly. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ lib/uri/common.rb | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 560a00ea7..59a4f4373 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,12 @@ +Thu Sep 18 20:02:48 2008 Yusuke Endoh + + * lib/uri/common.rb (unescape): skip '%' to make String#hex work + correctly. + Thu Sep 18 19:43:04 2008 Yusuke Endoh * st.c (new_size): raise RuntimeError when st_table is too big. + [ruby-dev:36354] Thu Sep 18 18:23:23 2008 Tanaka Akira diff --git a/lib/uri/common.rb b/lib/uri/common.rb index 98dda2a35..9a6a06894 100644 --- a/lib/uri/common.rb +++ b/lib/uri/common.rb @@ -227,7 +227,7 @@ module URI end def unescape(str, escaped = @regexp[:ESCAPED]) - str.gsub(escaped) { [$&.hex].pack('U') } + str.gsub(escaped) { [$&[1, 2].hex].pack('U') } end @@to_s = Kernel.instance_method(:to_s) -- cgit