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+. #