Added encryption stuff + rewrote sendWernisApiRequest() to handle the decryption.
[mailer.git] / inc / template-functions.php
index caa72894e601397b79899555565c2e7778104e3e..d4bd6354fa62f3d7c80f39cbfb730bdb743c35b8 100644 (file)
@@ -11,7 +11,7 @@
  * Kurzbeschreibung  : Template-Funktionen                              *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2013 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2015 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -226,6 +226,9 @@ function compileFinalOutput () {
 
 // Main compilation loop
 function doFinalCompilation ($code, $insertComments = TRUE, $enableCodes = TRUE) {
+       // Code must not be an array (happens in installer)
+       assert(!is_array($code));
+
        // Insert comments? (Only valid with HTML templates, of course)
        enableTemplateHtml($insertComments);
 
@@ -240,6 +243,7 @@ function doFinalCompilation ($code, $insertComments = TRUE, $enableCodes = TRUE)
 
                // Compile it
                //* DEBUG: */ debugOutput('<pre>'.lineNumberCode($code).'</pre>');
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'code[]=' . gettype($code) . ',enableCodes[]=' . gettype($enableCodes));
                $eval = '$newContent = "' . str_replace('{DQUOTE}', '"', compileCode(escapeQuotes($code), $enableCodes)) . '";';
                //* DEBUG: */ if (!$insertComments) print('EVAL=<pre>'.lineNumberCode($eval).'</pre>');
                eval($eval);
@@ -1827,7 +1831,7 @@ function generateSelectionBoxFromArray ($options, $name, $optionKey, $optionCont
        // Allow none?
        if ($allowNone === TRUE) {
                // Then add it
-               $OUT .= '<option value="0">{--SELECT_NONE--}</option>';
+               $OUT .= '<option value="">{--SELECT_NONE--}</option>';
        } // END - if
 
        // Walk through all options
@@ -1837,7 +1841,7 @@ function generateSelectionBoxFromArray ($options, $name, $optionKey, $optionCont
 
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'name=' . $name . ',default[' . gettype($default) . ']=' . $default . ',optionKey[' . gettype($optionKey) . ']=' . $optionKey);
                // Is default value same as given value?
-               if ((!is_null($default)) && (isset($option[$optionKey])) && ($default == $option[$optionKey])) {
+               if ((!is_null($default)) && (isset($option[$optionKey])) && ($default === $option[$optionKey])) {
                        // Then set default
                        $option['default'] = ' selected="selected"';
                } // END - if