]> git.cworth.org Git - sup/commitdiff
minor mime fix: detect filenames without quotes around them in content-disposition
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Sun, 8 Jul 2007 15:27:14 +0000 (15:27 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Sun, 8 Jul 2007 15:27:14 +0000 (15:27 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@485 5c8cc53c-5e98-4d25-b20a-d8db53a31250

lib/sup/message.rb

index 9be71c1626f85b83efdafbd421775cfa0ce959c0..f9693dd19cb2fad18df3767e9acba91c72f1bc0c 100644 (file)
@@ -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