X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Ffunctions.php;h=dc31759fc8479eee9c9f1b4719ba81aec2a0f2a1;hb=17b79f707a3470590e0444e86efad5d951e66696;hp=0d11b7f068a7c2b06f0409adfcabe0e0710e16aa;hpb=aaf81b8f35512782d34f78c1a0dac8b42d745393;p=mailer.git
diff --git a/inc/functions.php b/inc/functions.php
index 0d11b7f068..dc31759fc8 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -184,7 +184,7 @@ function compileFinalOutput () {
// Output the raw HTML code
function outputRawCode ($htmlCode) {
// Output stripped HTML code to avoid broken JavaScript code, etc.
- print($htmlCode);
+ print(str_replace('{BACK}', "\\", $htmlCode));
// Flush the output if only getPhpCaching() is not 'on'
if (getPhpCaching() != 'on') {
@@ -288,20 +288,20 @@ function loadTemplate ($template, $return = false, $content = array()) {
// Normal HTML output?
if (getOutputMode() == '0') {
// Add surrounding HTML comments to help finding bugs faster
- $ret = "\n" . $GLOBALS['tpl_content'] . "\n";
+ $ret = '\n" . $GLOBALS['tpl_content'] . '\n";
// Prepare eval() command
$eval = '$ret = "' . compileCode(escapeQuotes($ret)) . '";';
} elseif (substr($template, 0, 3) == 'js_') {
// JavaScripts don't like entities and timings
- $eval = '$ret = decodeEntities("' . compileRawCode(escapeQuotes($GLOBALS['tpl_content'])) . '");';
+ $eval = '$ret = decodeEntities("' . compileRawCode(escapeJavaScriptQuotes($GLOBALS['tpl_content'])) . '");';
} else {
- // Prepare eval() command
- $eval = '$ret = "' . compileCode(escapeQuotes($GLOBALS['tpl_content'])) . '";';
+ // Prepare eval() command, other output doesn't like entities, maybe
+ $eval = '$ret = decodeEntities("' . compileRawCode(escapeQuotes($GLOBALS['tpl_content'])) . '");';
}
} else {
// Add surrounding HTML comments to help finding bugs faster
- $ret = "\n" . $GLOBALS['tpl_content'] . "\n";
+ $ret = '\n" . $GLOBALS['tpl_content'] . '\n";
$eval = '$ret = "' . escapeQuotes($ret) . '";';
} // END - if
@@ -529,7 +529,7 @@ function sendEmail ($toEmail, $subject, $message, $isHtml = 'N', $mailHeader = '
//* DEBUG: */ outputHtml(__FUNCTION__."(".__LINE__."):TO={$toEmail},SUBJECT={$subject}
");
// Compile subject line (for POINTS constant etc.)
- eval("\$subject = decodeEntities(\"".compileRawCode(escapeQuotes($subject))."\");");
+ eval("\$subject = decodeEntities(\"".compileCode(escapeQuotes($subject))."\");");
// Set from header
if ((!eregi('@', $toEmail)) && ($toEmail > 0)) {
@@ -575,10 +575,10 @@ function sendEmail ($toEmail, $subject, $message, $isHtml = 'N', $mailHeader = '
}
// Compile "TO"
- eval("\$toEmail = \"".compileRawCode(escapeQuotes($toEmail))."\";");
+ eval("\$toEmail = \"".compileCode(escapeQuotes($toEmail))."\";");
// Compile "MSG"
- eval("\$message = \"".compileRawCode(escapeQuotes($message))."\";");
+ eval("\$message = \"".compileCode(escapeQuotes($message))."\";");
// Fix HTML parameter (default is no!)
if (empty($isHtml)) $isHtml = 'N';
@@ -1076,13 +1076,13 @@ function compileRawCode ($code, $simple = false, $constants = true, $full = true
// Replace it in the code
//* DEBUG: */ outputHtml(__FUNCTION__."(".__LINE__."):key={$key},match={$match}
");
$newMatch = str_replace('[', "['", str_replace(']', "']", $match));
- $code = str_replace($match, "\"." . $newMatch.".\"", $code);
+ $code = str_replace($match, '".' . $newMatch . '."', $code);
$matchesFound[$key . '_' . $matches[4][$key]] = 1;
$matchesFound[$match] = 1;
} elseif (!isset($matchesFound[$match])) {
// Not yet replaced!
//* DEBUG: */ outputHtml(__FUNCTION__."(".__LINE__."):match={$match}
");
- $code = str_replace($match, "\"." . $match.".\"", $code);
+ $code = str_replace($match, '".' . $match . '."', $code);
$matchesFound[$match] = 1;
}
} // END - foreach
@@ -3565,7 +3565,7 @@ function linenumberCode ($code) {
$r .= '|';
// Add code
- $r .= '' . secureString($c) . '';
+ $r .= '' . htmlentities($c) . '';
}
return '