Fixes for sending pool / setter
[mailer.git] / inc / functions.php
index c55b421dd3eb12a381c5c75e3caaea541276aa23..e32114a46e717753adf5828f7992b5bba29a0e9f 100644 (file)
@@ -44,7 +44,8 @@ if (!defined('__SECURITY')) {
 // Output HTML code directly or 'render' it. You addionally switch the new-line character off
 function outputHtml ($htmlCode, $newLine = true) {
        // Transfer username
-       $username = getUsername();
+       $username = getMessage('USERNAME_UNKNOWN');
+       if (isset($GLOBALS['username'])) $username = getUsername();
 
        // Do we have HTML-Code here?
        if (!empty($htmlCode)) {
@@ -559,8 +560,12 @@ function loadEmailTemplate ($template, $content = array(), $UID = '0') {
        unset($content);
        unset($DATA);
 
-       // Return compiled content
-       return compileCode($newContent);
+       // Compile the code and eval it
+       $eval = '$newContent = "' . compileCode(addSmartSlashes($newContent)) . '";';
+       eval($eval);
+
+       // Return content
+       return $newContent;
 }
 
 // Send mail out to an email address