X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=src%2Fcompose.php;h=0e7dcfbe78f93cfc2f339b4cd1ca226b1606e390;hp=daae7b63b2f32fbffbe94e44f4a945513886d706;hb=c5d828b34ad16d7eccc94db221ed3aaa7fc85feb;hpb=1e62a204a9ceb60f3cde686d60efc85436a2fbd2 diff --git a/src/compose.php b/src/compose.php index daae7b63..0e7dcfbe 100644 --- a/src/compose.php +++ b/src/compose.php @@ -1,5 +1,11 @@ header; + if ($ent_num) + $message = getEntity($message, $ent_num); if ($message->header->type0 == "text" || $message->header->type1 == "message") { - $body = decodeBody(mime_fetch_body($imapConnection, $id, $message->header->entity_id), $message->header->encoding); + if ($ent_num) + $body = decodeBody(mime_fetch_body($imapConnection, $id, $ent_num), $message->header->encoding); + else + $body = decodeBody(mime_fetch_body($imapConnection, $id, 1), $message->header->encoding); } else { $body = ""; } - if ($forward_id) - $tmp = _("-------- Original Message ---------\n"); if ($message->header->type1 == "html") $body = strip_tags($body); $body_ary = explode("\n", $body); $body = ""; for ($i=0; $i < count($body_ary); $i++) { - $tmp = $body_ary[$i]; - + if ($i==0 && $forward_id) { + $tmp = "-------- " . _("Original Message") . " --------\n"; + $tmp .= _("Subject") . ": " . $orig_header->subject . "\n"; + $tmp .= " " . _("From") . ": " . $orig_header->from . "\n"; + $tmp .= " " . _("To") . ": " . $orig_header->to[0] . "\n"; + if (count($orig_header->to) > 1) { + for ($x=1; $x < count($orig_header->to); $x++) { + $tmp .= " " . $orig_header->to[$x] . "\n"; + } + } + $tmp .= "\n" . $body_ary[$i]; + } else { + $tmp = $body_ary[$i]; + } if ($forward_id) $body = "$body$tmp\n"; else $body = "$body> $tmp\n"; } - + sqimap_mailbox_close($imapConnection); + return $body; } + $send_to = sqStripSlashes($send_to); + if (!$send_to) { $send_to = sqimap_find_email($send_to); } - $send_to = ereg_replace("\"", "", $send_to); - $send_to = stripslashes($send_to); - /** This formats a CC string if they hit "reply all" **/ if ($send_to_cc != "") { + $send_to_cc = ereg_replace( '"[^"]*"', "", $send_to_cc); $send_to_cc = ereg_replace(";", ",", $send_to_cc); $sendcc = explode(",", $send_to_cc); $send_to_cc = ""; @@ -111,7 +138,7 @@ $attachments, $subject, $newmail, $use_javascript_addr_book, $send_to_bcc, $reply_id, $mailbox; - $subject = decodeHeader($subject); + $subject = sqStripSlashes(decodeHeader($subject)); $reply_subj = decodeHeader($reply_subj); $forward_subj = decodeHeader($forward_subj); @@ -127,64 +154,61 @@ } echo "\n