From 550faa3399b4b6facb1ff0e2a467ea2175f88dd9 Mon Sep 17 00:00:00 2001 From: Jason Cleeland Date: Tue, 11 May 2004 12:28:05 +0000 Subject: [PATCH] Uses crlf_lineendings($text) function to normalise line endings in email message before sending. Fixed bug - $sid not globalised in function. git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@1025 b72ed6b6-b9f8-46b5-92b4-906544132732 --- index.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/index.php b/index.php index 6dd142f887b..611f24a8ceb 100644 --- a/index.php +++ b/index.php @@ -738,7 +738,8 @@ function submittokens() $langdir2="$homedir/lang/english"; } require("$langdir2/messages.php"); - $add = str_replace("\n", "\r\n", _TC_EMAILCONFIRM); + echo "\n"; + $add = _TC_EMAILCONFIRM; } $add = str_replace("{FIRSTNAME}", $cnfrow['firstname'], $add); $add = str_replace("{LASTNAME}", $cnfrow['lastname'], $add); @@ -746,7 +747,7 @@ function submittokens() $add = str_replace("{ADMINEMAIL}", $thissurvey['adminemail'], $add); $add = str_replace("{SURVEYNAME}", $thissurvey['name'], $add); $message .= $add; -// } + $message=crlf_lineendings($message); //Only send confirmation email if there is a valid email address if (validate_email($cnfrow['email'])) {mail($to, $subject, $message, $headers);} @@ -784,6 +785,7 @@ function sendsubmitnotification($sendnotification) $message .= "----------------------------\r\n\r\n"; } $message.= "PHP Surveyor"; + $message = crlf_lineendings($message); $headers = "From: {$thissurvey['adminemail']}\r\n"; mail($thissurvey['adminemail'], $subject, $message, $headers); } @@ -791,7 +793,7 @@ function sendsubmitnotification($sendnotification) function submitfailed() { global $thissurvey; - global $thistpl, $subquery; + global $thistpl, $subquery, $sid; sendcacheheaders(); echo "\n"; foreach(file("$thistpl/startpage.pstpl") as $op) @@ -814,6 +816,7 @@ function submitfailed() . "$subquery\n\n" . _DNSAVEEMAIL4.":\n" . mysql_error()."\n\n"; + $email=crlf_lineendings($email); mail($thissurvey['adminemail'], _DNSAVEEMAIL5, $email); } else