Permalink
Browse files

Rtrim() quoted lines on conversion to flowed format (according to RFC…

…2646)
  • Loading branch information...
1 parent 7ebed11 commit 87a96809c7a067f8cc140884558898fd92c87032 @alecpl alecpl committed Jan 21, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 program/lib/Roundcube/rcube_mime.php
@@ -544,8 +544,8 @@ public static function format_flowed($text, $length = 72, $charset=null)
if ($line[0] == '>') {
// remove quote chars, store level in $level
$line = preg_replace('/^>+/', '', $line, -1, $level);
- // remove (optional) space-staffing
- $line = preg_replace('/^ /', '', $line);
+ // remove (optional) space-staffing and spaces before the line end
+ $line = preg_replace('/(^ | +$)/', '', $line);
$prefix = str_repeat('>', $level) . ' ';
$line = $prefix . self::wordwrap($line, $length - $level - 2, " \r\n$prefix", false, $charset);
}

0 comments on commit 87a9680

Please sign in to comment.