fixed the attachment problem
authorlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 25 Aug 2000 01:52:05 +0000 (01:52 +0000)
committerlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 25 Aug 2000 01:52:05 +0000 (01:52 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@722 7612ce4b-ef26-0410-bec9-ea0150e637f0

src/compose.php

index d57e733..666326a 100644 (file)
       $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";
       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)) {
       $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;
          }