mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
* 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
This commit is contained in:
parent
34918aa832
commit
b5f91deee0
2 changed files with 8 additions and 2 deletions
|
@ -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+.
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue