commit 8b98322a2a6bb0cbc6ea8901eface46ea6f24e92
parent 1064da8553261bdd1aad789e82ef000888c86fa4
Author: Gregor Hoffleit <gregor@sam.mediasupervision.de>
Date: Tue, 12 Oct 2010 18:04:37 +0200
Bugfix: Correctly split list of mail addresses
split_on_commas() fails to work correctly for wrapped header lines:
Cc: John Doe , Foo Bar
Sup parsed this (in lib/sup/person.rb, Person.from_address_list) as:
Cc: John Doe ,
foo.bar
I fixed this by normalizing the whitespace before working the
regex in split_on_commas.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/sup/util.rb b/lib/sup/util.rb
@@ -224,7 +224,7 @@ class String
## a very complicated regex found on teh internets to split on
## commas, unless they occurr within double quotes.
def split_on_commas
- split(/,\s*(?=(?:[^"]*"[^"]*")*(?![^"]*"))/)
+ normalize_whitespace().split(/,\s*(?=(?:[^"]*"[^"]*")*(?![^"]*"))/)
end
## ok, here we do it the hard way. got to have a remainder for purposes of