diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-09-19 16:20:39 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-09-19 16:20:39 +0000 |
| commit | f14dc81f3b83936ab39d5b80d11ea8686f0014cc (patch) | |
| tree | 3bef5aa6f520c43ae553de13d193c591d2eb378b /roundcubemail/program/include | |
| parent | 8457107e75f9fba6ca0d597544a5ecf253507425 (diff) | |
applied tensor's patch: incorrect handling of filename of second and subsequent long non-ASCII attachments
git-svn-id: https://svn.roundcube.net/trunk@1849 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include')
| -rw-r--r-- | roundcubemail/program/include/rcube_imap.php | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/roundcubemail/program/include/rcube_imap.php b/roundcubemail/program/include/rcube_imap.php index 0a90fedbe..ad56a3a74 100644 --- a/roundcubemail/program/include/rcube_imap.php +++ b/roundcubemail/program/include/rcube_imap.php @@ -1198,9 +1198,10 @@ class rcube_imap } // some servers (eg. dovecot-1.x) have no support for parameter value continuations // we must fetch and parse headers "manually" + //TODO: fetching headers for a second time is not effecient, this code should be moved somewhere earlier --tensor if ($i<2) { // TODO: fetch only Content-Type/Content-Disposition header - $headers = iil_C_FetchPartBody($this->conn, $this->mailbox, $this->_msg_id, $struct->mime_id.'.HEADER'); + $headers = iil_C_FetchPartHeader($this->conn, $this->mailbox, $this->_msg_id, $part->mime_id); $filename_mime = ''; $i = 0; while (preg_match('/filename\*'.$i.'\s*=\s*"*([^"\n;]+)[";]*/', $headers, $matches)) { @@ -1216,9 +1217,9 @@ class rcube_imap $filename_encoded .= $part->d_parameters['filename*'.$i.'*']; } if ($i<2) { - $headers = iil_C_FetchPartBody($this->conn, $this->mailbox, $this->_msg_id, $struct->mime_id.'.HEADER'); + $headers = iil_C_FetchPartHeader($this->conn, $this->mailbox, $this->_msg_id, $part->mime_id); $filename_encoded = ''; - $i = 0; + $i = 0; $matches = array(); while (preg_match('/filename\*'.$i.'\*\s*=\s*"*([^"\n;]+)[";]*/', $headers, $matches)) { $filename_encoded .= $matches[1]; $i++; @@ -1232,9 +1233,9 @@ class rcube_imap $filename_mime .= $part->ctype_parameters['name*'.$i]; } if ($i<2) { - $headers = iil_C_FetchPartBody($this->conn, $this->mailbox, $this->_msg_id, $struct->mime_id.'.HEADER'); + $headers = iil_C_FetchPartHeader($this->conn, $this->mailbox, $this->_msg_id, $part->mime_id); $filename_mime = ''; - $i = 0; + $i = 0; $matches = array(); while (preg_match('/\s+name\*'.$i.'\s*=\s*"*([^"\n;]+)[";]*/', $headers, $matches)) { $filename_mime .= $matches[1]; $i++; @@ -1248,9 +1249,9 @@ class rcube_imap $filename_encoded .= $part->ctype_parameters['name*'.$i.'*']; } if ($i<2) { - $headers = iil_C_FetchPartBody($this->conn, $this->mailbox, $this->_msg_id, $struct->mime_id.'.HEADER'); + $headers = iil_C_FetchPartHeader($this->conn, $this->mailbox, $this->_msg_id, $part->mime_id); $filename_encoded = ''; - $i = 0; + $i = 0; $matches = array(); while (preg_match('/\s+name\*'.$i.'\*\s*=\s*"*([^"\n;]+)[";]*/', $headers, $matches)) { $filename_encoded .= $matches[1]; $i++; |
