From 76e8a9e82870393e5cef137526e811a878404096 Mon Sep 17 00:00:00 2001 From: akira Date: Sun, 20 Oct 2002 10:54:19 +0000 Subject: should raise InvalidComponentError if MAILTO_REGEXP could not match with @opaque. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/uri/mailto.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/uri/mailto.rb') 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 -- cgit v1.2.3