X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fdownload.php;h=bdd2a23c3b45448b5bebc8d64ef4735eceb0715a;hb=3cd52f38c5e51e948d935cd9e9e1f480b685ac3d;hp=b14cfd8f7d9a9d86d5efa23bfbb32772c95f3955;hpb=2b64659747776ed791389955cc915cfb7f0b89b2;p=squirrelmail.git diff --git a/src/download.php b/src/download.php index b14cfd8f..bdd2a23c 100644 --- a/src/download.php +++ b/src/download.php @@ -3,17 +3,20 @@ /** * download.php * - * Copyright (c) 1999-2003 The SquirrelMail Project Team + * Copyright (c) 1999-2004 The SquirrelMail Project Team * Licensed under the GNU GPL. For full terms see the file COPYING. * * Handles attachment downloads to the users computer. * Also allows displaying of attachments when possible. * - * $Id$ + * @version $Id$ * @package squirrelmail */ -/** Path for SquirrelMail required files. */ +/** + * Path for SquirrelMail required files. + * @ignore + */ define('SM_PATH','../'); /* SquirrelMail required files. */ @@ -38,8 +41,6 @@ if ( sqgetGlobalVar('passed_id', $temp, SQ_GET) ) { /* end globals */ -global $uid_support; - $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); $mbx_response = sqimap_mailbox_select($imapConnection, $mailbox); @@ -93,29 +94,25 @@ if (is_object($message->header->disposition)) { $filename = $header->getParameter('name'); } +//$filename = decodeHeader($filename, false, false); //Don't want html output nor utf8 because it will return html output $filename = decodeHeader($filename, true, false); //Don't want html output if (strlen($filename) < 1) { - if ($type1 == 'plain' && $type0 == 'text') { + //$filename = decodeHeader($subject, false, false); //Don't want html output nor utf8 because it will return html output + $filename = decodeHeader($subject, true, false); //Don't want html output + if ($type1 == 'plain' && $type0 == 'text') $suffix = 'txt'; - $filename = $subject . '.txt'; - } else if ($type1 == 'richtext' && $type0 == 'text') { + else if ($type1 == 'richtext' && $type0 == 'text') $suffix = 'rtf'; - $filename = $subject . '.rtf'; - } else if ($type1 == 'postscript' && $type0 == 'application') { + else if ($type1 == 'postscript' && $type0 == 'application') $suffix = 'ps'; - $filename = $subject . '.ps'; - } else if ($type1 == 'rfc822' && $type0 == 'message') { - $suffix = 'eml'; - $filename = $subject . '.msg'; - } else { + else if ($type1 == 'rfc822' && $type0 == 'message') + $suffix = 'msg'; + else $suffix = $type1; - } - if (strlen($filename) < 1) { - $filename = 'untitled'.strip_tags($ent_id).'.'.$suffix; - } else { - $filename = "$filename.$suffix"; - } + if ($filename == '') + $filename = 'untitled' . strip_tags($ent_id); + $filename = $filename . '.' . $suffix; } /*