align cases so they're easier to find..
[squirrelmail.git] / src / download.php
index 16d93dcd506a07e2cd87bfcea542b47715f64c94..710bdb6afac6ef283fca481115ac5f1c94f2a1e2 100644 (file)
@@ -36,7 +36,6 @@ if ( sqgetGlobalVar('passed_id', $temp, SQ_GET) ) {
 }  
 
 /* end globals */
-$mailbox = urldecode($mailbox);
 
 global $uid_support;
 
@@ -66,7 +65,8 @@ if ($ent_id) {
     /* raw message */
     $type0 = 'message';
     $type1 = 'rfc822';
-    $encoding = "US-ASCII";
+    $encoding = 'US-ASCII';
+    $header = $message->header;
 }
 
 /*
@@ -93,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') {
@@ -112,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";
     }