From a794e82c35c289d8db8537ae2a711a8290e9de6d Mon Sep 17 00:00:00 2001 From: lkehresman Date: Thu, 12 Oct 2000 15:30:39 +0000 Subject: [PATCH] runs message through sqWordWrap before putting it in compose area on reply git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@793 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/strings.php | 1 + src/compose.php | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/functions/strings.php b/functions/strings.php index 82d30580..fa1d84f9 100644 --- a/functions/strings.php +++ b/functions/strings.php @@ -51,6 +51,7 @@ function sqWordWrap(&$line, $wrap) { preg_match("/^([\s>]*)([^\s>].*)$/", $line, $regs); $beginning_spaces = $regs[1]; + $regs[2] .= "\n"; $words = explode(" ", $regs[2]); $i = 0; diff --git a/src/compose.php b/src/compose.php index bcc27970..48e7087a 100644 --- a/src/compose.php +++ b/src/compose.php @@ -41,7 +41,7 @@ // This function is used when not sending or adding attachments function newMail () { global $forward_id, $imapConnection, $msg, $ent_num, $body_ary, $body, - $reply_id, $send_to, $send_to_cc, $mailbox, $send_to_bcc; + $reply_id, $send_to, $send_to_cc, $mailbox, $send_to_bcc, $editor_size; $send_to = sqStripSlashes(decodeHeader($send_to)); $send_to_cc = sqStripSlashes(decodeHeader($send_to_cc)); @@ -72,6 +72,13 @@ if ($message->header->type1 == "html") $body = strip_tags($body); + $body_ary = explode("\n", $body); + $body = ""; + for ($i=0; $i < count($body_ary); $i++) { + sqWordWrap($body_ary[$i], $editor_size - 1); + $body .= $body_ary[$i]; + } + $body_ary = array(); $body_ary = explode("\n", $body); $body = ""; for ($i=0; $i < count($body_ary); $i++) { @@ -94,6 +101,7 @@ else $body = "$body> $tmp\n"; } + sqimap_mailbox_close($imapConnection); return $body; } -- 2.25.1