Browse Source

* Found my bug

Tyler Akins 24 năm trước cách đây
mục cha
commit
9798d0a2aa
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      functions/smtp.php

+ 2 - 1
functions/smtp.php

@@ -100,7 +100,8 @@
 	          $tmp = str_replace("\r\n", "\n", $tmp);
 	          $tmp = str_replace("\r\n", "\n", $tmp);
 	          $tmp = str_replace("\r", "\n", $tmp);
 	          $tmp = str_replace("\r", "\n", $tmp);
 	          $tmp = str_replace("\n", "\r\n", $tmp);
 	          $tmp = str_replace("\n", "\r\n", $tmp);
-		  $tmp .= "\r\n";
+		  if (feof($fp) && substr($tmp, -2) != "\r\n")
+		     $tmp .= "\r\n";
 		  fputs($fp, $tmp);
 		  fputs($fp, $tmp);
 		  $length += strlen($tmp);
 		  $length += strlen($tmp);
 	       }
 	       }