summaryrefslogtreecommitdiff
path: root/lib/uri/common.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/uri/common.rb')
-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+.
#