Changeset 1849 in subversion


Ignore:
Timestamp:
Sep 19, 2008 12:20:39 PM (5 years ago)
Author:
alec
Message:

applied tensor's patch: incorrect handling of filename of second and subsequent long non-ASCII attachments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/include/rcube_imap.php

    r1801 r1849  
    11991199      // some servers (eg. dovecot-1.x) have no support for parameter value continuations 
    12001200      // we must fetch and parse headers "manually" 
     1201      //TODO: fetching headers for a second time is not effecient, this code should be moved somewhere earlier --tensor 
    12011202      if ($i<2) { 
    12021203        // TODO: fetch only Content-Type/Content-Disposition header 
    1203         $headers = iil_C_FetchPartBody($this->conn, $this->mailbox, $this->_msg_id, $struct->mime_id.'.HEADER'); 
     1204        $headers = iil_C_FetchPartHeader($this->conn, $this->mailbox, $this->_msg_id, $part->mime_id); 
    12041205        $filename_mime = ''; 
    12051206        $i = 0; 
     
    12171218        } 
    12181219      if ($i<2) { 
    1219         $headers = iil_C_FetchPartBody($this->conn, $this->mailbox, $this->_msg_id, $struct->mime_id.'.HEADER'); 
     1220        $headers = iil_C_FetchPartHeader($this->conn, $this->mailbox, $this->_msg_id, $part->mime_id); 
    12201221        $filename_encoded = ''; 
    1221         $i = 0; 
     1222        $i = 0; $matches = array(); 
    12221223        while (preg_match('/filename\*'.$i.'\*\s*=\s*"*([^"\n;]+)[";]*/', $headers, $matches)) { 
    12231224          $filename_encoded .= $matches[1]; 
     
    12331234        } 
    12341235      if ($i<2) { 
    1235         $headers = iil_C_FetchPartBody($this->conn, $this->mailbox, $this->_msg_id, $struct->mime_id.'.HEADER'); 
     1236        $headers = iil_C_FetchPartHeader($this->conn, $this->mailbox, $this->_msg_id, $part->mime_id); 
    12361237        $filename_mime = ''; 
    1237         $i = 0; 
     1238        $i = 0; $matches = array(); 
    12381239        while (preg_match('/\s+name\*'.$i.'\s*=\s*"*([^"\n;]+)[";]*/', $headers, $matches)) { 
    12391240          $filename_mime .= $matches[1]; 
     
    12491250        } 
    12501251      if ($i<2) { 
    1251         $headers = iil_C_FetchPartBody($this->conn, $this->mailbox, $this->_msg_id, $struct->mime_id.'.HEADER'); 
     1252        $headers = iil_C_FetchPartHeader($this->conn, $this->mailbox, $this->_msg_id, $part->mime_id); 
    12521253        $filename_encoded = ''; 
    1253         $i = 0; 
     1254        $i = 0; $matches = array(); 
    12541255        while (preg_match('/\s+name\*'.$i.'\*\s*=\s*"*([^"\n;]+)[";]*/', $headers, $matches)) { 
    12551256          $filename_encoded .= $matches[1]; 
Note: See TracChangeset for help on using the changeset viewer.