More fixes for installation and extension registration
[mailer.git] / inc / functions.php
index 51e21667aac2164e7a38215c9a04b448d9569413..eb36b77d60840cef80982cc30d907c83fb9cbdd9 100644 (file)
@@ -588,10 +588,10 @@ 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>
        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)) . '
-To      : ' . htmlentities($toEmail) . '
-Subject : ' . htmlentities($subject) . '
-Message : ' . htmlentities($message) . '
+Headers : ' . htmlentities(utf8_decode(trim($mailHeader))) . '
+To      : ' . htmlentities(utf8_decode($toEmail)) . '
+Subject : ' . htmlentities(utf8_decode($subject)) . '
+Message : ' . htmlentities(utf8_decode($message)) . '
 </pre>');
        } elseif (($isHtml == 'Y') && (isExtensionActive('html_mail'))) {
                // Send mail as HTML away
 </pre>');
        } elseif (($isHtml == 'Y') && (isExtensionActive('html_mail'))) {
                // Send mail as HTML away
@@ -1384,6 +1384,16 @@ function generateImageOrCode ($img_code, $headerSent = true) {
 }
 // Create selection box or array of splitted timestamp
 function createTimeSelections ($timestamp, $prefix = '', $display = '', $align = 'center', $return_array=false) {
 }
 // Create selection box or array of splitted timestamp
 function createTimeSelections ($timestamp, $prefix = '', $display = '', $align = 'center', $return_array=false) {
+       // Do not continue if ONE_DAY is absend
+       if (!isConfigEntrySet('ONE_DAY')) {
+               // And return the timestamp itself or empty array
+               if ($return_array === true) {
+                       return array();
+               } else {
+                       return $timestamp;
+               }
+       } // END - if
+
        // Calculate 2-seconds timestamp
        $stamp = round($timestamp);
        //* DEBUG: */ print("*" . $stamp.'/' . $timestamp."*<br />");
        // Calculate 2-seconds timestamp
        $stamp = round($timestamp);
        //* DEBUG: */ print("*" . $stamp.'/' . $timestamp."*<br />");
@@ -2081,6 +2091,9 @@ function scrambleString($str) {
                $scrambleNums = explode(':', genScrambleString(strlen($str)));
        }
 
                $scrambleNums = explode(':', genScrambleString(strlen($str)));
        }
 
+       // Compare both lengths and abort if different
+       if (strlen($str) != count($scrambleNums)) return $str;
+
        // Scramble string here
        //* DEBUG: */ outputHtml('***Original=' . $str.'***<br />');
        for ($idx = '0'; $idx < strlen($str); $idx++) {
        // Scramble string here
        //* DEBUG: */ outputHtml('***Original=' . $str.'***<br />');
        for ($idx = '0'; $idx < strlen($str); $idx++) {