align cases so they're easier to find..
[squirrelmail.git] / src / download.php
index dcbc23a659da3d66caf2201e555b21110ac16f48..710bdb6afac6ef283fca481115ac5f1c94f2a1e2 100644 (file)
@@ -65,7 +65,8 @@ if ($ent_id) {
     /* raw message */
     $type0 = 'message';
     $type1 = 'rfc822';
-    $encoding = "US-ASCII";
+    $encoding = 'US-ASCII';
+    $header = $message->header;
 }
 
 /*
@@ -92,6 +93,7 @@ if (is_object($message->header->disposition)) {
 } else {
     $filename = $header->getParameter('name');
 }
+
 $filename = decodeHeader($filename);
 if (strlen($filename) < 1) {
     if ($type1 == 'plain' && $type0 == 'text') {
@@ -111,7 +113,7 @@ if (strlen($filename) < 1) {
     }
 
     if (strlen($filename) < 1) {
-       $filename = 'untitled'.strip_tags($ent_id).$suffix;
+       $filename = 'untitled'.strip_tags($ent_id).'.'.$suffix;
     } else {
        $filename = "$filename.$suffix";
     }