X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fdownload.php;h=5feed3eafcf5871c56b75e7c654d38cdffebca18;hb=b7043f905faff3c0e7e6ab8bfe7a658372de3ce2;hp=a7286c9513a05d64b4e03ce215a5607d10c250b9;hpb=89c7fc5a9108a6140cdf7e03465ba237a39912be;p=squirrelmail.git diff --git a/src/download.php b/src/download.php index a7286c95..5feed3ea 100644 --- a/src/download.php +++ b/src/download.php @@ -3,7 +3,7 @@ /** * 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. @@ -96,7 +96,8 @@ if (is_object($message->header->disposition)) { //$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) { - $filename = $subject; + //$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'; else if ($type1 == 'richtext' && $type0 == 'text') @@ -105,10 +106,11 @@ if (strlen($filename) < 1) { $suffix = 'ps'; else if ($type1 == 'rfc822' && $type0 == 'message') $suffix = 'msg'; - else { - $filename = 'untitled' . strip_tags($ent_id); + else $suffix = $type1; - } + + if ($filename == '') + $filename = 'untitled' . strip_tags($ent_id); $filename = $filename . '.' . $suffix; }