summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-11-19 11:18:15 +0100
committerAleksander Machniak <alec@alec.pl>2012-11-19 11:18:15 +0100
commit42b8a60cf33eb3eb768b11b9c94f79b152f75ca5 (patch)
tree50d4b6e8e227ffc36d07c924b4d17ec26279acf1
parent37557b5f086d64348a42dccaf922e541b87c2d13 (diff)
Fix wrapping of quoted text with format=flowed (#1488177)
-rw-r--r--CHANGELOG1
-rw-r--r--program/include/rcube_mime.php10
2 files changed, 6 insertions, 5 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 2f313d667..cb7cf677a 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================
+- Fix wrapping of quoted text with format=flowed (#1488177)
- Select default_addressbook on the list in Address Book (#1488280)
- Fix so mobile phone has TYPE=CELL in exported vCard (#1488812)
- Support contacts import from CSV file (#1486399)
diff --git a/program/include/rcube_mime.php b/program/include/rcube_mime.php
index ac3ef9e8a..48175b46a 100644
--- a/program/include/rcube_mime.php
+++ b/program/include/rcube_mime.php
@@ -539,11 +539,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 . self::wordwrap($line, $length - $level - 2, " \r\n$prefix ", false, $charset);
+ 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 . self::wordwrap($line, $length - $level - 2, " \r\n$prefix", false, $charset);
}
else if ($line) {
$line = self::wordwrap(rtrim($line), $length - 2, " \r\n", false, $charset);