From 0a85b0c192bba91ebb61059dfc2c9ca3cf403aed Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 9 Aug 2010 04:19:37 +0000 Subject: [PATCH] Fix for broken emails... :( --- inc/expression-functions.php | 2 +- inc/functions.php | 8 ++++---- inc/template-functions.php | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/inc/expression-functions.php b/inc/expression-functions.php index b1a31c4a0f..c8129ddb21 100644 --- a/inc/expression-functions.php +++ b/inc/expression-functions.php @@ -168,7 +168,7 @@ function doExpressionConfig ($data) { // Do we have a special expression function for it? if (isExpressionFunctionAvaiable($data)) { // Then use it - $replacer = '{DQUOTE} . ' . $data['callback'] . '('.getExpressionFunction($data).'(' . "'" . $data['matches'][4][$data['key']] . "'" . ')) . {DQUOTE}'; + $replacer = '{DQUOTE} . ' . $data['callback'] . '(' . getExpressionFunction($data) . '()) . {DQUOTE}'; } else { // Default replacer is the config value itself $replacer = '{DQUOTE} . ' . $data['callback'] . '(getConfig(' . "'" . $data['matches'][4][$data['key']] . "'" . ')) . {DQUOTE}'; diff --git a/inc/functions.php b/inc/functions.php index 00cfe3b84c..9f3bf52436 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -181,12 +181,12 @@ function checkPhpMailerUsage() { // Send out a raw email with PHPMailer class or legacy mail() command function sendRawEmail ($toEmail, $subject, $message, $headers) { // Just compile all to put out all configs, etc. - $eval = '$toEmail = decodeEntities("' . doFinalCompilation(compileRawCode(escapeQuotes($toEmail)), false) . '"); '; - $eval .= '$subject = decodeEntities("' . doFinalCompilation(compileRawCode(escapeQuotes($subject)), false) . '"); '; - $eval .= '$headers = decodeEntities("' . doFinalCompilation(compileRawCode(escapeQuotes($headers)), false) . '"); '; + $eval = '$toEmail = decodeEntities("' . escapeQuotes(doFinalCompilation(compileRawCode($toEmail), false)) . '"); '; + $eval .= '$subject = decodeEntities("' . escapeQuotes(doFinalCompilation(compileRawCode($subject), false)) . '"); '; + $eval .= '$headers = decodeEntities("' . escapeQuotes(doFinalCompilation(compileRawCode($headers), false)) . '"); '; // Do not decode entities in the message because we also send HTML mails through this function - $eval .= '$message = "' . doFinalCompilation(compileRawCode(escapeQuotes($message)), false) . '";'; + $eval .= '$message = "' . escapeQuotes(doFinalCompilation(compileRawCode($message), false)) . '";'; // Run the final eval() command eval($eval); diff --git a/inc/template-functions.php b/inc/template-functions.php index 4086492753..65e73d005a 100644 --- a/inc/template-functions.php +++ b/inc/template-functions.php @@ -226,8 +226,9 @@ function doFinalCompilation ($code, $insertComments = true, $enableCodes = true) // Compile it //* DEBUG: */ debugOutput('
'.linenumberCode($code).'
'); $eval = '$newContent = "' . str_replace('{DQUOTE}', '"', compileCode(escapeQuotes($code), false, true, $enableCodes)) . '";'; - //* DEBUG: */ if (!$insertComments) print('
'.linenumberCode($eval).'
'); + //* DEBUG: */ if (!$insertComments) print('EVAL=
'.linenumberCode($eval).'
'); eval($eval); + //* DEBUG: */ if (!$insertComments) print('NEW=
'.linenumberCode($newContent).'
'); //* DEBUG: */ die('
'.encodeEntities($newContent).'
'); // Was that eval okay? -- 2.39.5