X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fdownload.php;h=c5b8efb6ca3e2bb5e34de92ba02eab25385dea09;hb=8654383dd9cfe18b98c44d6d58ed2980b0890028;hp=12e508a449a303dc59aee154d4728c85e6d44a84;hpb=fa7ba04eb8a06761371014e2bd941a0c03a78774;p=squirrelmail.git diff --git a/src/download.php b/src/download.php index 12e508a4..c5b8efb6 100644 --- a/src/download.php +++ b/src/download.php @@ -3,7 +3,7 @@ /** * download.php * - * Copyright (c) 1999-2004 The SquirrelMail Project Team + * Copyright (c) 1999-2005 The SquirrelMail Project Team * Licensed under the GNU GPL. For full terms see the file COPYING. * * Handles attachment downloads to the users computer. @@ -39,6 +39,9 @@ sqgetGlobalVar('absolute_dl',$absolute_dl, SQ_GET); if ( sqgetGlobalVar('passed_id', $temp, SQ_GET) ) { $passed_id = (int) $temp; } +if (!sqgetGlobalVar('account', $account, SQ_GET) ) { + $account = 0; +} global $default_charset; set_my_charset(); @@ -46,7 +49,7 @@ set_my_charset(); /* end globals */ $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); -$aMailbox = sqm_api_mailbox_select($imapConnection, $mailbox,array(),array()); +$aMailbox = sqm_api_mailbox_select($imapConnection, $account, $mailbox,array(),array()); if (isset($aMailbox['MSG_HEADERS'][$passed_id]['MESSAGE_OBJECT']) && is_object($aMailbox['MSG_HEADERS'][$passed_id]['MESSAGE_OBJECT']) ) { @@ -108,7 +111,7 @@ if (is_object($message->header->disposition)) { $filename = $header->getParameter('name'); } -$filename = decodeHeader($filename,true,true); +$filename = decodeHeader($filename,true,false); $filename = charset_encode($filename,$default_charset,false); // If name is not set, use subject of email @@ -143,7 +146,7 @@ if (strlen($filename) < 1) { * most likely display the attachment inline inside the browser. * And finally, the third one will be used by default. If it * is displayable (text or html), it will load them up in a text - * viewer (built in to squirrelmail). Otherwise, it sets the + * viewer (built in to SquirrelMail). Otherwise, it sets the * content-type as application/octet-stream */ if (isset($absolute_dl) && $absolute_dl) { @@ -156,4 +159,4 @@ if (isset($absolute_dl) && $absolute_dl) { mime_print_body_lines ($imapConnection, $passed_id, $ent_id, $encoding); $mailbox_cache[$aMailbox['NAME']] = $aMailbox; sqsession_register($mailbox_cache,'mailbox_cache'); -?> +?> \ No newline at end of file