//* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):TO={$toEmail},SUBJECT={$subject}<br />");
// Compile subject line (for POINTS constant etc.)
- eval("\$subject = decodeEntities(\"".compileCode(escapeQuotes($subject))."\");");
+ eval("\$subject = decodeEntities(\"".compileRawCode(escapeQuotes($subject))."\");");
// Set from header
if ((!eregi('@', $toEmail)) && ($toEmail > 0)) {
}
// Compile "TO"
- eval("\$toEmail = \"".compileCode(escapeQuotes($toEmail))."\";");
+ eval("\$toEmail = \"".compileRawCode(escapeQuotes($toEmail))."\";");
// Compile "MSG"
- eval("\$message = \"".compileCode(escapeQuotes($message))."\";");
+ eval("\$message = \"".compileRawCode(escapeQuotes($message))."\";");
// Fix HTML parameter (default is no!)
if (empty($isHtml)) $isHtml = 'N';
}
}
-// Check if legacy or PHPMailer command
+// Check to use wether legacy mail() command or PHPMailer class
// @TODO Rewrite this to an extension 'smtp'
// @private
function checkPhpMailerUsage() {
// Send out a raw email with PHPMailer class or legacy mail() command
function sendRawEmail ($toEmail, $subject, $message, $from) {
+ // Just compile all again, to put out all configs, etc.
+ eval('$toEmail = decodeEntities("' . compileCode(escapeQuotes($toEmail)) . '");');
+ eval('$subject = decodeEntities("' . compileCode(escapeQuotes($subject)) . '");');
+ eval('$message = decodeEntities("' . compileCode(escapeQuotes($message)) . '");');
+ eval('$from = decodeEntities("' . compileCode(escapeQuotes($from)) . '");');
+
// Shall we use PHPMailer class or legacy mode?
if (checkPhpMailerUsage()) {
// Use PHPMailer class with SMTP enabled
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_points` WHERE `userid`=%s", array(bigintval($userid)), __FUNCTION__, __LINE__);
// Update mediadata as well
- if (getExtensionVersion('mediadata') >= '0.0.4') {
+ if (isExtensionInstalledAndNewer('mediadata', '0.0.4')) {
// Update database
updateMediadataEntry(array('total_points'), 'sub', $points);
} // END - if