fix for "untitled" attachment names
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 13 Aug 2002 12:16:59 +0000 (12:16 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 13 Aug 2002 12:16:59 +0000 (12:16 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3292 7612ce4b-ef26-0410-bec9-ea0150e637f0

src/compose.php

index ef06f01..190f1d6 100644 (file)
@@ -614,8 +614,13 @@ function getAttachments($message, $session, $passed_id, $entities, $imapConnecti
                }
            } else {
                $filename = decodeHeader($message->header->getParameter('filename'));
-               if ($filename == "") {
-                  $filename = "untitled-".$message->entity_id;
+               if ($filename == '') {
+                 $name = decodeHeader($message->header->getParameter('name'));
+                 if ($name == '') {
+                     $filename = "untitled-".$message->entity_id;
+                 } else {
+                    $filename = $name;
+                 }
                }
             }
             $localfilename = GenerateRandomString(32, '', 7);