From 0a06275a4e995c93efea0268753bc329353d2614 Mon Sep 17 00:00:00 2001 From: stekkel Date: Fri, 30 May 2003 17:17:50 +0000 Subject: [PATCH] logmes git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4954 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/mime.php | 16 +++++++++++++++- src/compose.php | 16 +++++++++++----- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/functions/mime.php b/functions/mime.php index 8e599f3b..7a183616 100644 --- a/functions/mime.php +++ b/functions/mime.php @@ -547,7 +547,7 @@ function decodeBody($body, $encoding) { * Patched by Christian Schmidt 23/03/2002 */ function decodeHeader ($string, $utfencode=true,$htmlsave=true) { - global $languages, $squirrelmail_language; + global $default_charset, $languages, $squirrelmail_language; if (is_array($string)) { $string = implode("\n", $string); } @@ -561,6 +561,11 @@ function decodeHeader ($string, $utfencode=true,$htmlsave=true) { $i = 0; $iLastMatch = -2; $encoded = false; + + if (strtolower($default_charset) == 'iso-8859-1') { + $string = str_replace("\240",' ',$string); + } + $aString = explode(' ',$string); $ret = ''; foreach ($aString as $chunk) { @@ -629,6 +634,15 @@ function decodeHeader ($string, $utfencode=true,$htmlsave=true) { } ++$i; } + /* remove the first added space */ + if ($ret) { + if ($htmlsave) { + $ret = substr($ret,6); + } else { + $ret = substr($ret,1); + } + } + return $ret; } diff --git a/src/compose.php b/src/compose.php index 99af71aa..e5d206b7 100644 --- a/src/compose.php +++ b/src/compose.php @@ -361,7 +361,9 @@ if ($send) { } else { sqWordWrap($line, $editor_size); $newBody .= $line . "\n"; + } + } $body = $newBody; do_hook('compose_send'); @@ -655,10 +657,14 @@ function newMail ($mailbox='', $passed_id='', $passed_ent_id='', $action='', $se switch ($action) { case ('draft'): $use_signature = FALSE; + $composeMessage->rfc822_header = $orig_header; $send_to = decodeHeader($orig_header->getAddr_s('to'),false,true); $send_to_cc = decodeHeader($orig_header->getAddr_s('cc'),false,true); $send_to_bcc = decodeHeader($orig_header->getAddr_s('bcc'),false,true); $subject = decodeHeader($orig_header->subject,false,true); +// /* remember the references and in-reply-to headers in case of an reply */ +// $composeMessage->rfc822_header->more_headers['References'] = $orig_header->references; +// $composeMessage->rfc822_header->more_headers['In-Reply-To'] = $orig_header->in_reply_to; $body_ary = explode("\n", $body); $cnt = count($body_ary) ; $body = ''; @@ -1022,21 +1028,21 @@ function showInputForm ($session, $values=false) { if ($default_charset == 'iso-2022-jp') { echo "\n\n".($prefix_sig==true? "-- \n":'').mb_convert_encoding($signature, 'EUC-JP'); } else { - echo "\n\n".($prefix_sig==true? "-- \n":'').decodeHeader($signature,false); + echo "\n\n".($prefix_sig==true? "-- \n":'').decodeHeader($signature,false,false); } - echo "\n\n".decodeHeader($body,false,true); + echo "\n\n".decodeHeader($body,false,false); } else { - echo "\n\n".decodeHeader($body,false,true); + echo "\n\n".decodeHeader($body,false,false); if ($default_charset == 'iso-2022-jp') { echo "\n\n".($prefix_sig==true? "-- \n":'').mb_convert_encoding($signature, 'EUC-JP'); }else{ - echo "\n\n".($prefix_sig==true? "-- \n":'').decodeHeader($signature,false,true); + echo "\n\n".($prefix_sig==true? "-- \n":'').decodeHeader($signature,false,false); } } } else { - echo decodeHeader($body,false,true); + echo decodeHeader($body,false,false); } echo '
' . "\n" . ' ' . "\n" . -- 2.25.1