X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Ffunctions.php;h=d94a0336fee24b04d53de9fb23c67cc9fd9ece54;hp=f2806f6b648279ee09bbe01fa3165063fd4b8e6b;hb=307a4e11763f0914e73dc756b219356e1c29ab25;hpb=7ec9a232162634c199cc28ba050be9b4f8214e7f diff --git a/inc/functions.php b/inc/functions.php index f2806f6b64..d94a0336fe 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -138,8 +138,16 @@ function OUTPUT_HTML($HTML, $NEW_LINE = true) { // Compile and run finished rendered HTML code while (strpos($OUTPUT, '{!') > 0) { - $eval = "\$OUTPUT = \"" . COMPILE_CODE(addslashes($OUTPUT)) . "\";"; - eval($eval); + // Prepare the content and eval() it... + $newContent = ""; + $eval = "\$newContent = \"" . COMPILE_CODE(addslashes($OUTPUT)) . "\";"; + @eval($eval); + + if (empty($newContent)) { + // Something went wrong! + die("Evaluation error:
".htmlentities($eval)."
"); + } + $OUTPUT = $newContent; } // Output code here, DO NOT REMOVE! ;-) @@ -360,7 +368,7 @@ function SEND_EMAIL($TO, $SUBJECT, $MSG, $HTML='N', $FROM="") { } // Fix HTML parameter (default is no!) - if (empty($HTML)) $HTML = 'N'; + if (empty($HTML)) $HTML = "N"; if (isBooleanConstantAndTrue('DEBUG_MODE')) { // In debug mode we want to display the mail instead of sending it away so we can debug this part echo "
@@ -369,7 +377,7 @@ To      : ".$TO."
 Subject : ".$SUBJECT."
 Message : ".$MSG."
 
\n"; - } elseif (($HTML == 'Y') && (EXT_IS_ACTIVE("html_mail", true))) { + } elseif (($HTML == "Y") && (EXT_IS_ACTIVE("html_mail", true))) { // Send mail as HTML away SEND_HTML_EMAIL($TO, $SUBJECT, $MSG, $FROM); } elseif (!empty($TO)) { @@ -378,7 +386,7 @@ Message : ".$MSG." // Send Mail away SEND_RAW_EMAIL($TO, COMPILE_CODE($SUBJECT), COMPILE_CODE($MSG), $FROM); - } elseif ($HTML == 'N') { + } elseif ($HTML == "N") { // Problem found! SEND_RAW_EMAIL(WEBMASTER, COMPILE_CODE($SUBJECT), COMPILE_CODE($MSG), $FROM); } @@ -676,7 +684,7 @@ function LOAD_EMAIL_TEMPLATE($template, $content="", $UID="0") { // Keept for backward-compatiblity (please replace these variables against our new {--CONST--} syntax!) $MAIN_TITLE = MAIN_TITLE; $URL = URL; $WEBMASTER = WEBMASTER; - $surname = ""; $family = ""; $nick = ""; $sex = 'N'; + $surname = ""; $family = ""; $nick = ""; $sex = "N"; // Prepare IP number and User Agent $REMOTE_ADDR = getenv('REMOTE_ADDR'); @@ -814,7 +822,7 @@ function LOAD_EMAIL_TEMPLATE($template, $content="", $UID="0") { } } else { // Neutral sex and email address is default - $sex = 'N'; + $sex = "N"; $email = WEBMASTER; } @@ -1154,10 +1162,10 @@ function ADD_SELECTION($type, $DEFAULT, $prefix="", $id="0") case "yn": $OUT .= "