aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--lib/uri/common.rb4
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 12bbad5bbb..1e0bb5689e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri Jul 22 21:18:20 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:06:39 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
* object.c (rb_mod_{const,cvar}_defined, rb_obj_ivar_defined):
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+.
#