diff options
author | akira <akira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-10-20 10:54:19 +0000 |
---|---|---|
committer | akira <akira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-10-20 10:54:19 +0000 |
commit | 76e8a9e82870393e5cef137526e811a878404096 (patch) | |
tree | 2256463ddbde9f93bdef715f373ea82fefd3c798 /lib/uri | |
parent | 8232622071b61db04cd6f0e3a32b7608360e6b25 (diff) | |
download | ruby-76e8a9e82870393e5cef137526e811a878404096.tar.gz |
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
Diffstat (limited to 'lib/uri')
-rw-r--r-- | lib/uri/mailto.rb | 5 |
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 |