Skip to content

Commit

Permalink
Uses crlf_lineendings($text) function to normalise line endings in em…
Browse files Browse the repository at this point in the history
…ail 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
  • Loading branch information
jcleeland committed May 11, 2004
1 parent fbf4448 commit 550faa3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions index.php
Expand Up @@ -738,15 +738,16 @@ function submittokens()
$langdir2="$homedir/lang/english";
}
require("$langdir2/messages.php");
$add = str_replace("\n", "\r\n", _TC_EMAILCONFIRM);
echo "<!-- Sending Default Email -->\n";
$add = _TC_EMAILCONFIRM;
}
$add = str_replace("{FIRSTNAME}", $cnfrow['firstname'], $add);
$add = str_replace("{LASTNAME}", $cnfrow['lastname'], $add);
$add = str_replace("{ADMINNAME}", $thissurvey['adminname'], $add);
$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);}

Expand Down Expand Up @@ -784,14 +785,15 @@ 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);
}

function submitfailed()
{
global $thissurvey;
global $thistpl, $subquery;
global $thistpl, $subquery, $sid;
sendcacheheaders();
echo "<html>\n";
foreach(file("$thistpl/startpage.pstpl") as $op)
Expand All @@ -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
Expand Down

0 comments on commit 550faa3

Please sign in to comment.