]> git.mxchange.org Git - mailer.git/blobdiff - inc/functions.php
These JavaScript templates cannot be lincesed properly (GNU header is gigantic compar...
[mailer.git] / inc / functions.php
index f35ee954c60d3d74e065fbe730f9f71980a696bd..e768c7e02e630b837283730f0b28c489beb825e6 100644 (file)
@@ -202,11 +202,11 @@ function sendRawEmail ($toEmail, $subject, $message, $headers) {
                $mail->Subject    = $subject;
                if ((isExtensionActive('html_mail')) && (secureString($message) != $message)) {
                        $mail->Body       = $message;
-                       $mail->AltBody    = 'Your mail program required HTML support to read this mail!';
+                       $mail->AltBody    = decodeEntities($message);
                        $mail->WordWrap   = 70;
                        $mail->IsHTML(true);
                } else {
-                       $mail->Body       = decodeEntities($message);
+                       $mail->Body       = decodeEntities(strip_tags($message));
                }
 
                $mail->AddAddress($toEmail, '');
@@ -534,6 +534,12 @@ function makeTime ($hours, $minutes, $seconds, $stamp) {
 
 // Redirects to an URL and if neccessarry extends it with own base URL
 function redirectToUrl ($url, $allowSpider = true) {
+       // Is the output mode -2?
+       if (getScriptOutputMode() == -2) {
+               // This is always (!) an AJAX request and shall not be redirected
+               return;
+       } // END - if
+
        // Remove {%url=
        if (substr($url, 0, 6) == '{%url=') {
                $url = substr($url, 6, -2);
@@ -1048,11 +1054,17 @@ function getCurrentTheme () {
        // The default theme is 'default'... ;-)
        $ret = 'default';
 
-       // Do we have ext-theme installed and active?
-       if (isExtensionActive('theme')) {
+       // Do we have ext-theme installed and active or is 'theme' in URL or POST data?
+       if ((isPostRequestElementSet('theme')) && (isIncludeReadable(sprintf("theme/%s/theme.php", postRequestElement('theme'))))) {
+               // Use value from POST data
+               $ret = postRequestElement('theme');
+       } elseif ((isGetRequestElementSet('theme')) && (isIncludeReadable(sprintf("theme/%s/theme.php", getRequestElement('theme'))))) {
+               // Use value from GET data
+               $ret = getRequestElement('theme');
+       } elseif (isExtensionActive('theme')) {
                // Call inner method
                $ret = getActualTheme();
-       } // END - if
+       }
 
        // Return theme value
        return $ret;
@@ -1372,11 +1384,11 @@ function changeDataInFile ($FQFN, $comment, $prefix, $suffix, $inserted, $seek=0
 function sendAdminNotification ($subject, $templateName, $content = array(), $userid = NULL) {
        if ((isExtensionInstalledAndNewer('admins', '0.4.1')) && (function_exists('sendAdminsEmails'))) {
                // Send new way
-               /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'admins=Y,subject=' . $subject . ',templateName=' . $templateName);
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'admins=Y,subject=' . $subject . ',templateName=' . $templateName . ' - OKAY!');
                sendAdminsEmails($subject, $templateName, $content, $userid);
        } else {
                // Send out-dated way
-               /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'admins=N,subject=' . $subject . ',templateName=' . $templateName);
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'admins=N,subject=' . $subject . ',templateName=' . $templateName . ' - OUT-DATED!');
                $message = loadEmailTemplate($templateName, $content, $userid);
                sendAdminEmails($subject, $message);
        }