From: tokul Date: Sun, 27 Jun 2004 09:18:43 +0000 (+0000) Subject: html output will be cleaned by encoding function X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=commitdiff_plain;h=fa7ba04eb8a06761371014e2bd941a0c03a78774 html output will be cleaned by encoding function git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@7697 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/src/download.php b/src/download.php index fa966ed4..12e508a4 100644 --- a/src/download.php +++ b/src/download.php @@ -40,6 +40,9 @@ if ( sqgetGlobalVar('passed_id', $temp, SQ_GET) ) { $passed_id = (int) $temp; } +global $default_charset; +set_my_charset(); + /* end globals */ $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); @@ -105,11 +108,13 @@ 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 +$filename = decodeHeader($filename,true,true); +$filename = charset_encode($filename,$default_charset,false); + +// If name is not set, use subject of email if (strlen($filename) < 1) { - //$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 + $filename = decodeHeader($subject, true, true); + $filename = charset_encode($filename,$default_charset,false); if ($type1 == 'plain' && $type0 == 'text') $suffix = 'txt'; else if ($type1 == 'richtext' && $type0 == 'text')