From 5da23242f5fca03aaedabbf984fff1c4c602f612 Mon Sep 17 00:00:00 2001 From: wmorgan Date: Sun, 8 Jul 2007 15:27:14 +0000 Subject: [PATCH] minor mime fix: detect filenames without quotes around them in content-disposition git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@485 5c8cc53c-5e98-4d25-b20a-d8db53a31250 --- lib/sup/message.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/sup/message.rb b/lib/sup/message.rb index 9be71c1..f9693dd 100644 --- a/lib/sup/message.rb +++ b/lib/sup/message.rb @@ -290,7 +290,7 @@ private filename = ## first, paw through the headers looking for a filename if m.header["Content-Disposition"] && - m.header["Content-Disposition"] =~ /filename="(.*?[^\\])"/ + m.header["Content-Disposition"] =~ /filename="?(.*?[^\\])("|;|$)/ $1 elsif m.header["Content-Type"] && m.header["Content-Type"] =~ /name=(.*?)(;|$)/ @@ -309,7 +309,6 @@ private ## otherwise, it's body text else body = Message.decode_and_convert m - text_to_chunks body.normalize_whitespace.split("\n") end end -- 2.45.2