]> git.mxchange.org Git - mailer.git/blobdiff - inc/functions.php
Add slashes instead of SQL_ESCAPE()
[mailer.git] / inc / functions.php
index fce1f0ab6e0e727d34263d390a064b763d24f575..25610ef39c4263cbded07e7e7d4ddf3acc22c15c 100644 (file)
@@ -527,10 +527,9 @@ function loadEmailTemplate ($template, $content = array(), $UID = 0) {
        if (isFileReadable($FQFN)) {
                // The local file does exists so we load it. :)
                $GLOBALS['tpl_content'] = readFromFile($FQFN);
-               $GLOBALS['tpl_content'] = SQL_ESCAPE($GLOBALS['tpl_content']);
 
                // Run code
-               $GLOBALS['tpl_content'] = "\$newContent = decodeEntities(\"".compileCode($GLOBALS['tpl_content'])."\");";
+               $GLOBALS['tpl_content'] = "\$newContent = decodeEntities(\"".compileCode(smartAddSlashes($GLOBALS['tpl_content']))."\");";
                eval($GLOBALS['tpl_content']);
        } elseif (!empty($template)) {
                // Template file not found!
@@ -600,7 +599,7 @@ function sendEmail ($toEmail, $subject, $message, $isHtml = 'N', $mailHeader = '
                        // Free result
                        SQL_FREERESULT($result_email);
                }
-       } elseif ($toEmail == 0) {
+       } elseif ($toEmail == '0') {
                // Is the webmaster!
                $toEmail = getConfig('WEBMASTER');
        }
@@ -637,7 +636,7 @@ function sendEmail ($toEmail, $subject, $message, $isHtml = 'N', $mailHeader = '
        if (isDebugModeEnabled()) {
                // In debug mode we want to display the mail instead of sending it away so we can debug this part
                outputHtml('<pre>
-Headers : ' . htmlentities(trim($mailHeader)) . '
+Headers : ' . str_replace('<', '&lt', str_replace('>', '&gt;', htmlentities(trim($mailHeader)))) . '
 To      : ' . $toEmail . '
 Subject : ' . $subject . '
 Message : ' . $message . '