From: wmorgan Date: Mon, 26 Nov 2007 20:12:56 +0000 (+0000) Subject: mime type filename detection patch form Nicolas Pouillard X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=0bc4913245635453fea1a43b7d43126d789eacb0;p=sup mime type filename detection patch form Nicolas Pouillard git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@723 5c8cc53c-5e98-4d25-b20a-d8db53a31250 --- diff --git a/lib/sup/message.rb b/lib/sup/message.rb index 8ec8a67..4131bfe 100644 --- a/lib/sup/message.rb +++ b/lib/sup/message.rb @@ -352,11 +352,9 @@ private else filename = ## first, paw through the headers looking for a filename - if m.header["Content-Disposition"] && - m.header["Content-Disposition"] =~ /filename="?(.*?[^\\])("|;|$)/ + if m.header["Content-Disposition"] && m.header["Content-Disposition"] =~ /filename="?(.*?[^\\])("|;|$)/ $1 - elsif m.header["Content-Type"] && - m.header["Content-Type"] =~ /name=(.*?)(;|$)/ + elsif m.header["Content-Type"] && m.header["Content-Type"] =~ /name="?(.*?[^\\])("|;|$)/ $1 ## haven't found one, but it's a non-text message. fake