From 5082e91876502a2f3dde862406a0efe9f85afcdb Mon Sep 17 00:00:00 2001 From: hone Date: Thu, 7 Aug 2014 04:59:52 +0000 Subject: [PATCH] merge revision(s) 32622: * lib/uri/generic.rb (WFKV_): unroll the loop of regexp. * lib/uri/generic.rb (URI.decode_www_form_component): ditto. Conflicts: ChangeLog lib/uri/common.rb git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@47092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ lib/uri/common.rb | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e18f0af513..04ef3ebb63 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Fri Jul 22 21:18:20 2011 NARUSE, Yui + + * lib/uri/generic.rb (WFKV_): unroll the loop of regexp. + + * lib/uri/generic.rb (URI.decode_www_form_component): ditto. + Fri Nov 22 12:43:52 2013 Nobuyoshi Nakada * util.c (ruby_strtod): ignore too long fraction part, which does not diff --git a/lib/uri/common.rb b/lib/uri/common.rb index 264fa053ed..b9335ebd04 100644 --- a/lib/uri/common.rb +++ b/lib/uri/common.rb @@ -762,7 +762,7 @@ module URI # # See URI.encode_www_form_component, URI.decode_www_form def self.decode_www_form_component(str, enc=Encoding::UTF_8) - raise ArgumentError, "invalid %-encoding (#{str})" unless /\A(?:%\h\h|[^%]+)*\z/ =~ str + raise ArgumentError, "invalid %-encoding (#{str})" unless /\A[^%]*(?:%\h\h[^%]*)*\z/ =~ str str.gsub(/\+|%\h\h/, TBLDECWWWCOMP_).force_encoding(enc) end @@ -798,7 +798,7 @@ module URI str end - WFKV_ = '(?:%\h\h|[^%#=;&])' # :nodoc: + WFKV_ = '(?:[^%#=;&]*(?:%\h\h[^%#=;&]*)*)' # :nodoc: # Decode URL-encoded form data from given +str+. #