summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-22 12:29:13 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-22 12:29:13 +0000
commitb5f91deee04aa6ccbe07c23c8222b937c22a799b (patch)
treef1666f6862ab4de518f99446c2442b29887d365b /lib
parent34918aa83260246e545911efe6e1672507c3e699 (diff)
* 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/trunk@32622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/uri/common.rb4
1 files changed, 2 insertions, 2 deletions
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+.
#