소스 검색

fixed the attachment problem

Luke Ehresman 25 년 전
부모
커밋
3efbc0ee4a
1개의 변경된 파일12개의 추가작업 그리고 8개의 파일을 삭제
  1. 12 8
      src/compose.php

+ 12 - 8
src/compose.php

@@ -140,6 +140,7 @@
       $subject = sqStripSlashes(decodeHeader($subject));
       $reply_subj = decodeHeader($reply_subj);
       $forward_subj = decodeHeader($forward_subj);
+      $body = sqStripSlashes($body);
 
       if ($use_javascript_addr_book) {
          echo "\n<SCRIPT LANGUAGE=JavaScript><!--\n";
@@ -257,7 +258,7 @@
       echo "     </td>\n";
       echo "   </tr>\n";
       if (isset($attachments) && count($attachments)>0) {
-         echo "</tr><tr><td bgcolor=\"$color[1]\" align=right>\n";
+         echo "<tr><td bgcolor=\"$color[0]\" align=right>\n";
          echo "&nbsp;";
          echo "</td><td align=left bgcolor=\"$color[0]\">";
          while (list($localname, $remotename) = each($attachments)) {
@@ -346,13 +347,16 @@
       $localfilename = $localfilename;
       
       // Put the file in a better place
-      $tmp=explode('/',$attachfile);
-      $attachfile=$tmp[count($tmp)-1];
-      $attachfile=ereg_replace('\.{2,}','',$attachfile);
-
-      error_reporting(0); // Rename will produce error output if it fails
-      if (!rename($attachfile, $attachment_dir.$localfilename)) {
-         if (!copy($attachfile, $attachment_dir.$localfilename)) {
+      // This shouldn't be here... Ondrej Sury <ondrej@sury.cz>
+      //$tmp=explode('/',$attachfile);
+      //$attachfile=$tmp[count($tmp)-1];
+      //$attachfile=ereg_replace('\.{2,}','',$attachfile);
+
+      //error_reporting(0); // Rename will produce error output if it fails
+      //if (!rename($attachfile, $attachment_dir.$localfilename)) {
+      //   if (!copy($attachfile, $attachment_dir.$localfilename)) {
+      if (!@rename($attachfile, $attachment_dir.$localfilename)) {
+         if (!@copy($attachfile, $attachment_dir.$localfilename)) {
             plain_error_message(_("Could not move/copy file. File not attached"), $color);
             $failed = true;
          }