diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-07-22 12:50:22 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-07-22 12:50:22 +0000 |
commit | 7ea6334d4cff81101a1f90fecf05c1372558d550 (patch) | |
tree | 426dca1d3fbff5d8a4b75b0124e1bed20814def0 | |
parent | 49995e8ed107b14eaac382f45347db2f1fff2a9e (diff) |
merge revision(s) 32622:
* lib/uri/generic.rb (WFKV_): unroll the loop of regexp.
* lib/uri/generic.rb (URI.decode_www_form_component): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@32627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | lib/uri/common.rb | 4 |
2 files changed, 8 insertions, 2 deletions
@@ -1,3 +1,9 @@ +Fri Jul 22 21:50:16 2011 NARUSE, Yui <naruse@ruby-lang.org> + + * lib/uri/generic.rb (WFKV_): unroll the loop of regexp. + + * lib/uri/generic.rb (URI.decode_www_form_component): ditto. + Fri Jul 22 21:49:48 2011 NARUSE, Yui <naruse@ruby-lang.org> * enum.c (enum_inject): remove empty line to notify rdoc diff --git a/lib/uri/common.rb b/lib/uri/common.rb index 92beafa8d8..8b9e1e3695 100644 --- a/lib/uri/common.rb +++ b/lib/uri/common.rb @@ -908,7 +908,7 @@ module URI rescue end end - 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 @@ -960,7 +960,7 @@ module URI end.join('&') end - WFKV_ = '(?:%\h\h|[^%#=;&])' # :nodoc: + WFKV_ = '(?:[^%#=;&]*(?:%\h\h[^%#=;&]*)*)' # :nodoc: # Decode URL-encoded form data from given +str+. # |