* Patched by Christian Schmidt <christian@ostenfeld.dk> 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);
}
$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) {
}
++$i;
}
+ /* remove the first added space */
+ if ($ret) {
+ if ($htmlsave) {
+ $ret = substr($ret,6);
+ } else {
+ $ret = substr($ret,1);
+ }
+ }
+
return $ret;
}
} else {
sqWordWrap($line, $editor_size);
$newBody .= $line . "\n";
+
}
+
}
$body = $newBody;
do_hook('compose_send');
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 = '';
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 '</textarea><br />' . "\n" .
' </td>' . "\n" .