From d8270b66ccca4aef0db76bade89a398b1d33abe9 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Mon, 18 Mar 2013 19:51:32 +0100 Subject: Fix wrapping of text lines with the same length as specified length limit --- program/lib/Roundcube/rcube_mime.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'program/lib') diff --git a/program/lib/Roundcube/rcube_mime.php b/program/lib/Roundcube/rcube_mime.php index 2f24a1bb3..d21e3b4d5 100644 --- a/program/lib/Roundcube/rcube_mime.php +++ b/program/lib/Roundcube/rcube_mime.php @@ -595,11 +595,12 @@ class rcube_mime while (count($list)) { $line = array_shift($list); $l = mb_strlen($line); - $newlen = $len + $l + ($len ? 1 : 0); + $space = $len ? 1 : 0; + $newlen = $len + $l + $space; if ($newlen <= $width) { - $string .= ($len ? ' ' : '').$line; - $len += (1 + $l); + $string .= ($space ? ' ' : '').$line; + $len += ($space + $l); } else { if ($l > $width) { -- cgit v1.2.3