summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorakira <akira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-10-20 10:54:19 +0000
committerakira <akira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-10-20 10:54:19 +0000
commit4e5185cedd727d2ba4c9611f568bf27ba13b4be9 (patch)
tree94911751418870312648a49de5b517f6db2795dd /lib
parent74be32bc2ccd17f97986f30cc14c5b76b66c9393 (diff)
should raise InvalidComponentError if MAILTO_REGEXP could not match with @opaque.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@2973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/uri/mailto.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/uri/mailto.rb b/lib/uri/mailto.rb
index 100cd6430b..d50d2b792f 100644
--- a/lib/uri/mailto.rb
+++ b/lib/uri/mailto.rb
@@ -51,7 +51,7 @@ module URI
# headers = "?" header *( "&" header )
# to = #mailbox
# mailtoURL = "mailto:" [ to ] [ headers ]
- MAILBOX_PATTERN = "(?:[^(),%?=&]|#{PATTERN::ESCAPED})".freeze
+ MAILBOX_PATTERN = "(?:#{PATTERN::ESCAPED}|[^(),%?=&])".freeze
MAILTO_REGEXP = Regexp.new("
\\A
(#{MAILBOX_PATTERN}*?) (?# 1: to)
@@ -128,7 +128,8 @@ module URI
set_to($1)
set_headers($2)
end
- elsif arg[-1]
+
+ else
raise InvalidComponentError,
"unrecognised opaque part for mailtoURL: #{@opaque}"
end