Luke Ehresman 25 年之前
父節點
當前提交
18f6d737fe
共有 3 個文件被更改,包括 22 次插入8 次删除
  1. 1 1
      functions/mailbox_display.php
  2. 19 5
      src/compose.php
  3. 2 2
      src/read_body.php

+ 1 - 1
functions/mailbox_display.php

@@ -11,7 +11,7 @@
    function printMessageInfo($imapConnection, $t, $i, $from, $subject, $dateString, $answered, $seen, $mailbox, $sort, $startMessage) {
       $senderName = getSenderName($from);
       $urlMailbox = urlencode($mailbox);
-      $subject = trim($subject);
+      $subject = trim(stripslashes($subject));
       echo "<TR>\n";
       if ($seen == false) {
          echo "   <TD><FONT FACE=\"Arial,Helvetica\"><nobr><B><input type=checkbox name=\"msg[$t]\" value=$i></B></nobr></FONT></TD>\n";

+ 19 - 5
src/compose.php

@@ -12,12 +12,23 @@
    $imapConnection = loginToImapServer($username, $key, $imapServerAddress);
    displayPageHeader("None");
 
-   if ($reply_id || $forward_id) {
+   if ($forward_id) {
       selectMailbox($imapConnection, $mailbox, $numMessages);
-      if ($reply_id)
-         $msg = fetchMessage($imapConnection, $reply_id);
-      else
-         $msg = fetchMessage($imapConnection, $forward_id);
+      $msg = fetchMessage($imapConnection, $forward_id);
+
+      $body_ary = formatBody($msg);
+      $tmp = "-------- Original Message ---------\n";
+      for ($i=0;$i < count($body_ary);$i++) {
+         $tmp .= strip_tags($body_ary[$i]);
+         $tmp = substr($tmp, 0, strlen($tmp) -1);
+         $body = "$body$tmp";
+         $tmp = "";
+      }
+   }
+
+   if ($reply_id) {
+      selectMailbox($imapConnection, $mailbox, $numMessages);
+      $msg = fetchMessage($imapConnection, $reply_id);
 
       $body_ary = formatBody($msg);
       for ($i=0;$i < count($body_ary);$i++) {
@@ -27,6 +38,9 @@
       }
    }
 
+   $send_to = ereg_replace("\"", "", $send_to);
+   $send_to = stripslashes($send_to);
+
    echo "<FORM action=\"compose_send.php\" METHOD=POST>\n";
    echo "<TABLE COLS=2 WIDTH=50 ALIGN=CENTER CELLSPACING=0 BORDER=0>\n";
    echo "   <TR>\n";

+ 2 - 2
src/read_body.php

@@ -20,7 +20,7 @@
    displayPageHeader($mailbox);
 
    /** translate the subject and mailbox into url-able text **/
-   $url_subj = urlencode(trim($message["HEADER"]["SUBJECT"]));
+   $url_subj = urlencode(trim(stripslashes($message["HEADER"]["SUBJECT"])));
    $urlMailbox = urlencode($mailbox);
    $url_replyto = urlencode($message["HEADER"]["REPLYTO"]);
 
@@ -76,7 +76,7 @@
 
    /** make sure everything will display in HTML format **/
    $from_name = htmlspecialchars($message["HEADER"]["FROM"]);
-   $subject = htmlspecialchars($message["HEADER"]["SUBJECT"]);
+   $subject = htmlspecialchars(stripslashes($message["HEADER"]["SUBJECT"]));
 
    echo "<BR>";
    echo "<TABLE COLS=1 WIDTH=95% BORDER=0 ALIGN=CENTER CELLPADDING=2>\n";