summaryrefslogtreecommitdiff
path: root/program/lib
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-05-03 09:26:13 +0200
committerAleksander Machniak <alec@alec.pl>2013-05-03 09:27:43 +0200
commit56aeedd9cd844046d9b65582ef69c38941c487fc (patch)
treed9a5ed52f55ef3362825943b562f6d43ef767663 /program/lib
parentc067bb55df07703545102df7b466aff482361eb8 (diff)
Fix bug where multi-level quoting was replaced with one-level quoted text after format=flowed wrapping
Diffstat (limited to 'program/lib')
-rw-r--r--program/lib/Roundcube/rcube_mime.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/program/lib/Roundcube/rcube_mime.php b/program/lib/Roundcube/rcube_mime.php
index 53724cbba..63549fbec 100644
--- a/program/lib/Roundcube/rcube_mime.php
+++ b/program/lib/Roundcube/rcube_mime.php
@@ -478,9 +478,10 @@ class rcube_mime
$q_level = 0;
foreach ($text as $idx => $line) {
- if ($line[0] == '>') {
- // remove quote chars, store level in $q
- $line = preg_replace('/^>+/', '', $line, -1, $q);
+ if (preg_match('/^(>+)/', $line, $m)) {
+ // remove quote chars
+ $q = strlen($m[1]);
+ $line = preg_replace('/^>+/', '', $line);
// remove (optional) space-staffing
$line = preg_replace('/^ /', '', $line);
@@ -543,9 +544,10 @@ class rcube_mime
foreach ($text as $idx => $line) {
if ($line != '-- ') {
- if ($line[0] == '>') {
- // remove quote chars, store level in $level
- $line = preg_replace('/^>+/', '', $line, -1, $level);
+ if (preg_match('/^(>+)/', $line, $m)) {
+ // remove quote chars
+ $level = strlen($m[1]);
+ $line = preg_replace('/^>+/', '', $line);
// remove (optional) space-staffing and spaces before the line end
$line = preg_replace('/(^ | +$)/', '', $line);
$prefix = str_repeat('>', $level) . ' ';