From d5cadfc1108728635055d476eff7b34c975705d6 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 13 Apr 2005 04:44:58 +0000 Subject: Address parsing failed when the "to" (or "cc", or whatever) was an array. It was also too restrictive in the formats of the addresses #1097 [Jamis] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1149 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionmailer/lib/action_mailer/base.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'actionmailer/lib') diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index a20197c754..27a0c8e19c 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -166,7 +166,9 @@ module ActionMailer #:nodoc: # it needs to be. This allows extended characters to be used in the # "to", "from", "cc", and "bcc" headers. def quote_address_if_necessary(address, charset) - if address =~ /^([^<>\s]+) (<.*>)$/ + if Array === address + address.map { |a| quote_address_if_necessary(a, charset) } + elsif address =~ /^(\S.+)\s+(<.*>)$/ address = $2 phrase = quote_if_necessary($1, charset) "#{phrase} #{address}" -- cgit v1.2.3