Ignore:
Timestamp:
10/18/10 13:48:42 (14 years ago)
Author:
rafaelraymundo
Message:

Ticket #1293 - Acerta encaminhamento de msgs com nome de anexo com caracteres especiais.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/expressoMail1_2/inc/gotodownload.php

    r3240 r3369  
    1212        $msg_number = $_GET['msg_number']; 
    1313        $idx_file = $_GET['idx_file']; 
    14         $newfilename = urldecode($_GET['newfilename']); 
     14        $newfilename = html_entity_decode(rawurldecode($_GET['newfilename'])); 
    1515        $msg_part = $_GET['msg_part']; 
    1616        $msg_folder = $_GET['msg_folder']; 
     
    2424                $password = $_SESSION['phpgw_info']['expressomail']['user']['passwd']; 
    2525                $imap_server = $_SESSION['phpgw_info']['expressomail']['email_server']['imapServer']; 
    26                 $imap_port      = $_SESSION['phpgw_info']['expressomail']['email_server']['imapPort'];           
     26                $imap_port      = $_SESSION['phpgw_info']['expressomail']['email_server']['imapPort']; 
    2727                if ($_SESSION['phpgw_info']['expressomail']['email_server']['imapTLSEncryption'] == 'yes') 
    2828                { 
     
    3333                        $imap_options = '/notls/novalidate-cert'; 
    3434                } 
    35                 $mbox_stream = imap_open("{".$imap_server.":".$imap_port.$imap_options."}".$msg_folder, $username, $password);           
     35                $mbox_stream = imap_open("{".$imap_server.":".$imap_port.$imap_options."}".$msg_folder, $username, $password); 
    3636                $fileContent = imap_fetchbody($mbox_stream, $msg_number, $msg_part, FT_UID); 
    3737                /* 
    3838                 *Removed by Bug #546 
    3939                 *include("class.imap_attachment.inc.php"); 
    40                  *$imap_attachment = new imap_attachment();                      
     40                 *$imap_attachment = new imap_attachment(); 
    4141                 *$a = $imap_attachment->download_attachment($mbox_stream, $msg_number); 
    4242                 *$filename = $a[$idx_file]['name']; 
     
    5454 
    5555        function downloadFile($strFileType, $strFileName, $newFileName, $fileContent, $encoding) { 
    56                 //avoid stuck request  
    57                 session_write_close();  
     56                //avoid stuck request 
     57                session_write_close(); 
    5858                $ContentType = "application/octet-stream"; 
    5959 
    60                 if ($strFileType == ".asf")  
     60                if ($strFileType == ".asf") 
    6161                        $ContentType = "video/x-ms-asf"; 
    6262                if ($strFileType == ".avi") 
     
    8282                if ($strFileType == ".htm" || $strFileType == "html") 
    8383                        $ContentType = "text/html"; 
    84                 if ($strFileType == ".xml")  
     84                if ($strFileType == ".xml") 
    8585                        $ContentType = "text/xml"; 
    86                 if ($strFileType == ".xsl")  
     86                if ($strFileType == ".xsl") 
    8787                        $ContentType = "text/xsl"; 
    88                 if ($strFileType == ".css")  
     88                if ($strFileType == ".css") 
    8989                        $ContentType = "text/css"; 
    90                 if ($strFileType == ".php")  
     90                if ($strFileType == ".php") 
    9191                        $ContentType = "text/php"; 
    92                 if ($strFileType == ".asp")  
     92                if ($strFileType == ".asp") 
    9393                        $ContentType = "text/asp"; 
    9494                if ($strFileType == ".pdf") 
     
    161161                header("Pragma: public"); 
    162162                header("Expires: 0"); // set expiration time 
    163                 header ("Content-Disposition: attachment; filename=\"". addslashes($newFileName)."\"");          
     163                header ("Content-Disposition: attachment; filename=\"". addslashes($newFileName)."\""); 
    164164                if($fileContent) { 
    165165                        if($encoding == 'base64') 
Note: See TracChangeset for help on using the changeset viewer.