Fix another text wrapping issue (wrong handling of long unwrappable lines)
| | |
| | | $subString = $substr_func($subString, 0, $spacePos, $charset); |
| | | $cutLength = $spacePos + 1; |
| | | } |
| | | else if ($cut === false && $breakPos === false) { |
| | | $subString = $string; |
| | | $cutLength = null; |
| | | } |
| | | else if ($cut === false) { |
| | | $spacePos = $strpos_func($string, ' ', 0, $charset); |
| | | |
| | |
| | | /** |
| | | * Wrap text to a given number of characters per line |
| | | * but respect the mail quotation of replies messages (>). |
| | | * Finally add another quotation level by prpending the lines |
| | | * Finally add another quotation level by prepending the lines |
| | | * with > |
| | | * |
| | | * @param string Text to wrap |
| | | * @param int The line width |
| | | * @param int The line width |
| | | * @return string The wrapped text |
| | | */ |
| | | function rcmail_wrap_and_quote($text, $length = 72) |
| | |
| | | $line = '>' . rtrim($line); |
| | | else if (mb_strlen($line) > $max) { |
| | | $newline = ''; |
| | | foreach(explode("\n", rc_wordwrap($line, $length - 2)) as $l) { |
| | | foreach (explode("\n", rc_wordwrap($line, $length - 2)) as $l) { |
| | | if (strlen($l)) |
| | | $newline .= '> ' . $l . "\n"; |
| | | else |
| | |
| | | array("-------\nabc def", 5), |
| | | "-------\nabc\ndef", |
| | | ), |
| | | array( |
| | | array("http://xx.xxx.xx.xxx:8080/addressbooks/roundcubexxxxx%40xxxxxxxxxxxxxxxxxxxxxxx.xx.xx/testing/", 70), |
| | | "http://xx.xxx.xx.xxx:8080/addressbooks/roundcubexxxxx%40xxxxxxxxxxxxxxxxxxxxxxx.xx.xx/testing/", |
| | | ), |
| | | ); |
| | | |
| | | foreach ($samples as $sample) { |