diff options
author | Aleksander Machniak <alec@alec.pl> | 2013-04-22 10:22:16 +0200 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2013-04-22 10:23:12 +0200 |
commit | a2446d929654a4d1be113d6cab6b7fff4ae4e382 (patch) | |
tree | 850c647b7ccae10ac67c9f4bed61e9485c9c8d0b | |
parent | 102b08c6a23a1388c95fae00d2ff850f1fa7e2c4 (diff) |
Fix another text wrapping issue
-rw-r--r-- | program/lib/Roundcube/rcube_mime.php | 4 | ||||
-rw-r--r-- | tests/Framework/Mime.php | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/program/lib/Roundcube/rcube_mime.php b/program/lib/Roundcube/rcube_mime.php index 1e4fac84a..96296a57c 100644 --- a/program/lib/Roundcube/rcube_mime.php +++ b/program/lib/Roundcube/rcube_mime.php @@ -622,7 +622,7 @@ class rcube_mime $subString = $substr_func($string, 0, $width, $charset); // last line - if ($subString === $string) { + if ($breakPos === false && $subString === $string) { $cutLength = null; } else { @@ -652,7 +652,7 @@ class rcube_mime else if ($cut === false) { $spacePos = $strpos_func($string, ' ', 0, $charset); - if ($spacePos !== false) { + if ($spacePos !== false && $spacePos < $breakPos) { $subString = $substr_func($string, 0, $spacePos, $charset); $cutLength = $spacePos + 1; } diff --git a/tests/Framework/Mime.php b/tests/Framework/Mime.php index f15379e5f..61123dd85 100644 --- a/tests/Framework/Mime.php +++ b/tests/Framework/Mime.php @@ -181,6 +181,10 @@ class Framework_Mime extends PHPUnit_Framework_TestCase array("abc def", 3, "-"), "abc-def", ), + array( + array("----------------------------------------------------------------------------------------\nabc def123456789012345", 76), + "----------------------------------------------------------------------------------------\nabc def123456789012345", + ), ); foreach ($samples as $sample) { |