get the filename from the properties if the is no disposition info available
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 30 Jan 2003 18:04:55 +0000 (18:04 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 30 Jan 2003 18:04:55 +0000 (18:04 +0000)
in the bodystructure.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4484 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/mime.php

index 320e67e5777cd0c18ee20d778df7c3877a84d376..09a76553a1231326a6693c9da7d423aedfee2223 100644 (file)
@@ -442,13 +442,15 @@ function formatAttachments($message, $exclude_id, $mailbox, $id) {
                     }
                 }
             } else {
-                if (trim( $header->id ) == '') {
-                    $filename = 'untitled-[' . $ent . ']' ;
-                } else {
-                    $filename = 'cid: ' . $header->id;
-                }
-            }
-
+               $filename = decodeHeader($header->getParameter('name'));
+               if (!trim($filename)) {
+                   if (trim( $header->id ) == '') {
+                       $filename = 'untitled-[' . $ent . ']' ;
+                   } else {
+                       $filename = 'cid: ' . $header->id;
+                   }
+               }
+           }
             if ($header->description) {
                 $description = htmlspecialchars($header->description);
             } else {