From f810c0b2e4ce80a92ff177e51aa1ec196347091e Mon Sep 17 00:00:00 2001 From: stekkel Date: Mon, 19 Aug 2002 09:55:34 +0000 Subject: [PATCH] fix for getting filenames for attachments git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3357 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/mime.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/functions/mime.php b/functions/mime.php index c91ea398..eb9dbd6c 100644 --- a/functions/mime.php +++ b/functions/mime.php @@ -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) { '  ' . "[ $type0/$type1 ] " . ''; - $attachments .= '' . $from_name . ''; + $attachments .= '' . $description . ''; $attachments .= ' '; $SkipSpaces = 1; -- 2.25.1