diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-05-25 11:34:51 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-05-25 11:34:51 +0000 |
| commit | 0373977b91e44dc6e70aae464e682ce255775aa3 (patch) | |
| tree | c5d2fb4dad53c9b74870e56dfc3839d4ae7d8199 | |
| parent | d1a4c437c3d0f42aa0b22a8b8444f6c9c1de231e (diff) | |
- small LF fix in quoted-printable convertion
git-svn-id: https://svn.roundcube.net/trunk@2533 208e9e7b-5314-0410-a742-e7e81cd9613c
| -rw-r--r-- | roundcubemail/program/lib/imap.inc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/roundcubemail/program/lib/imap.inc b/roundcubemail/program/lib/imap.inc index 932be4adf..1b8bec0fb 100644 --- a/roundcubemail/program/lib/imap.inc +++ b/roundcubemail/program/lib/imap.inc @@ -2396,9 +2396,8 @@ function iil_C_HandlePartBody(&$conn, $mailbox, $id, $part='', $encoding=NULL, $ } $bytes -= strlen($line); - $line = rtrim($line, "\t\r\n\0\x0B"); - if ($mode == 1) { + $line = rtrim($line, "\t\r\n\0\x0B"); // create chunks with proper length for base64 decoding $line = $prev.$line; $length = strlen($line); @@ -2417,7 +2416,7 @@ function iil_C_HandlePartBody(&$conn, $mailbox, $id, $part='', $encoding=NULL, $ else $result .= base64_decode($line); } else if ($mode == 2) { - $line .= $line[sizeof($line)-1] != '=' ? "\n" : ''; + $line = rtrim($line, "\t\r\0\x0B"); if ($file) fwrite($file, quoted_printable_decode($line)); else if ($print) @@ -2425,6 +2424,7 @@ function iil_C_HandlePartBody(&$conn, $mailbox, $id, $part='', $encoding=NULL, $ else $result .= quoted_printable_decode($line); } else if ($mode == 3) { + $line = rtrim($line, "\t\r\n\0\x0B"); if ($line == 'end' || preg_match('/^begin\s+[0-7]+\s+.+$/', $line)) continue; if ($file) @@ -2434,6 +2434,7 @@ function iil_C_HandlePartBody(&$conn, $mailbox, $id, $part='', $encoding=NULL, $ else $result .= convert_uudecode($line); } else { + $line = rtrim($line, "\t\r\n\0\x0B"); if ($file) fwrite($file, $line . "\n"); else if ($print) @@ -2443,6 +2444,7 @@ function iil_C_HandlePartBody(&$conn, $mailbox, $id, $part='', $encoding=NULL, $ } } } + // read in anything up until last line if (!$end) do { |
