aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--lib/uri/common.rb4
2 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index c925fb1bf6..1b24835fef 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Sat Jan 2 00:43:22 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/uri/common.rb (initialize_regexp): allow leading
+ and trailing white space, and forbid extra characters
+ on another lines. [ruby-core:26223]
+ RFC 3986 Appendix C. Delimiting a URI in Context
+ draft-duerst-iri-bis-07 7.2. Web Address processing
+
Fri Jan 1 23:17:49 2010 NARUSE, Yui <naruse@ruby-lang.org>
* lib/uri/generic.rb (URI#normalize!): normalize case of
diff --git a/lib/uri/common.rb b/lib/uri/common.rb
index 9f849c03a4..8958c79047 100644
--- a/lib/uri/common.rb
+++ b/lib/uri/common.rb
@@ -397,8 +397,8 @@ module URI
ret = {}
# for URI::split
- ret[:ABS_URI] = Regexp.new('^' + pattern[:X_ABS_URI] + '$', Regexp::EXTENDED)
- ret[:REL_URI] = Regexp.new('^' + pattern[:X_REL_URI] + '$', Regexp::EXTENDED)
+ ret[:ABS_URI] = Regexp.new('\A\s*' + pattern[:X_ABS_URI] + '\s*\z', Regexp::EXTENDED)
+ ret[:REL_URI] = Regexp.new('\A\s*' + pattern[:X_REL_URI] + '\s*\z', Regexp::EXTENDED)
# for URI::extract
ret[:URI_REF] = Regexp.new(pattern[:URI_REF])