fix for getting filenames for attachments
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 19 Aug 2002 09:55:34 +0000 (09:55 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 19 Aug 2002 09:55:34 +0000 (09:55 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3357 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/mime.php

index c91ea398b8f8054d433cd442030b7b016363738f..eb9dbd6cf118b86367c4cc1e46bf652cdfbc92ce 100644 (file)
@@ -407,11 +407,12 @@ function formatAttachments($message, $exclude_id, $mailbox, $id) {
                 $from_name = _("Unknown sender");
             }
             $from_name = decodeHeader(htmlspecialchars($from_name));
+           $description = $from_name;
         } else {
             $default_page = '../src/download.php';
-            $filename = decodeHeader($header->getParameter('filename'));
+            $filename = decodeHeader($header->disposition->getProperty('filename'));
             if (trim($filename) == '') {
-                $name = decodeHeader($header->getParameter('name'));
+                $name = decodeHeader($header->disposition->getProperty('name'));
                 if (trim($name) == '') {
                     if ( trim( $header->id ) == '' )
                         $filename = 'untitled-[' . $ent . ']' ;
@@ -421,9 +422,11 @@ function formatAttachments($message, $exclude_id, $mailbox, $id) {
                     $filename = $name;
                 }
             }
-            if ($message->header->description) {
-                $from_name = htmlspecialchars(_($header->description));
-            }
+            if ($header->description) {
+                $description = htmlspecialchars($header->description);
+            } else {
+               $description = '';
+           }
         }
 
         $display_filename = $filename;
@@ -454,7 +457,7 @@ function formatAttachments($message, $exclude_id, $mailbox, $id) {
                         '</b>&nbsp;&nbsp;</small></TD>' .
                         "<TD><SMALL>[ $type0/$type1 ]&nbsp;</SMALL></TD>" .
                         '<TD><SMALL>';
-        $attachments .= '<b>' . $from_name . '</b>';
+        $attachments .= '<b>' . $description . '</b>';
         $attachments .= '</SMALL></TD><TD><SMALL>&nbsp;';
 
         $SkipSpaces = 1;