diff options
author | Aleksander Machniak <alec@alec.pl> | 2012-11-19 11:18:15 +0100 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2012-11-23 09:30:47 +0100 |
commit | a0682b56d174bc801916f60f85f31f0513b660c6 (patch) | |
tree | fcd623fd360fbcee6ce692f409ae2d2a52c22de9 /program | |
parent | 77c9fd9f25cbee887278ba44269703b880472722 (diff) |
Fix wrapping of quoted text with format=flowed (#1488177)
Conflicts:
CHANGELOG
program/include/rcube_mime.php
Diffstat (limited to 'program')
-rw-r--r-- | program/include/rcube_mime.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/program/include/rcube_mime.php b/program/include/rcube_mime.php index 287bde851..d33c4eba6 100644 --- a/program/include/rcube_mime.php +++ b/program/include/rcube_mime.php @@ -540,11 +540,11 @@ class rcube_mime foreach ($text as $idx => $line) { if ($line != '-- ') { - if ($line[0] == '>' && preg_match('/^(>+)/', $line, $regs)) { - $prefix = $regs[0]; - $level = strlen($prefix); - $line = rtrim(substr($line, $level)); - $line = $prefix . rc_wordwrap($line, $length - $level - 2, " \r\n$prefix "); + if ($line[0] == '>' && preg_match('/^(>+ {0,1})+/', $line, $regs)) { + $level = substr_count($regs[0], '>'); + $prefix = str_repeat('>', $level) . ' '; + $line = rtrim(substr($line, strlen($regs[0]))); + $line = $prefix . rc_wordwrap($line, $length - $level - 2, " \r\n$prefix", false, $charset); } else if ($line) { $line = rc_wordwrap(rtrim($line), $length - 2, " \r\n"); |