]> git.cworth.org Git - sup/commitdiff
mime type filename detection patch form Nicolas Pouillard
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Mon, 26 Nov 2007 20:12:56 +0000 (20:12 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Mon, 26 Nov 2007 20:12:56 +0000 (20:12 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@723 5c8cc53c-5e98-4d25-b20a-d8db53a31250

lib/sup/message.rb

index 8ec8a673730312d5942e2512184d32a001d3481c..4131bfe42bf77c0f081bfae0580f238adf0501f3 100644 (file)
@@ -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