X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=src%2Fcompose.php;h=6d4c72383f3f9896c21ab1ed8efcf112508a2aef;hp=5057a585d6b4dee475bc9c82e155ae694aca35b0;hb=18c9998a873a4f1ebcb8dedb0612cf77c8e288d8;hpb=dc2db59a9dc72f62dec5b1ba92bd117b143010d0 diff --git a/src/compose.php b/src/compose.php index 5057a585..6d4c7238 100644 --- a/src/compose.php +++ b/src/compose.php @@ -369,12 +369,24 @@ if ($send) { $body = str_replace("\r", "\n", $body); /** - * If the browser doesn't support "VIRTUAL" as the wrap type. - * then the line length will be longer than $editor_size - * almost all browsers support VIRTUAL, so remove the line by line checking - * If this causes a problem, call sqBodyWrap + * Rewrap $body so that no line is bigger than $editor_size */ - // sqBodyWrap($body, $editor_size); + $body = explode("\n", $body); + $newBody = ''; + foreach ($body as $line) { + if( $line <> '-- ' ) { + $line = rtrim($line); + } + if (strlen($line) <= $editor_size + 1) { + $newBody .= $line . "\n"; + } else { + sqWordWrap($line, $editor_size); + $newBody .= $line . "\n"; + + } + + } + $body = $newBody; $composeMessage=$compose_messages[$session]; @@ -1547,4 +1559,4 @@ function deliverMessage($composeMessage, $draft=false) { } // vim: et ts=4 -?> \ No newline at end of file +?>