X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Ffunctions.php;h=eec116f9c7cd0c52b9a87f25ef4dd13ff2a8f696;hp=473c494382dfc52f9e3d88e2e1781bc076e9099b;hb=0715fa7aa8e5e70bcf1d957fb09ae655c3896c4e;hpb=4836fdd88165b4d32f5b826a93467d2bb293e3ad diff --git a/inc/functions.php b/inc/functions.php index 473c494382..eec116f9c7 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -45,7 +45,9 @@ if (!defined('__SECURITY')) { // Output HTML code directly or 'render' it. You addionally switch the new-line character off function outputHtml ($htmlCode, $newLine = true) { // Init output - if (!isset($GLOBALS['output'])) $GLOBALS['output'] = ''; + if (!isset($GLOBALS['output'])) { + $GLOBALS['output'] = ''; + } // END - if // Transfer username $username = getMessage('USERNAME_UNKNOWN'); @@ -149,19 +151,21 @@ function sendHttpHeaders () { // Compiles the final output function compileFinalOutput () { // Init counter - $cnt = '0'; + $cnt = 0; // Add page header and footer addPageHeaderFooter(); // Compile all out - while (((strpos($GLOBALS['output'], '{--') > 0) || (strpos($GLOBALS['output'], '{!') > 0) || (strpos($GLOBALS['output'], '{?') > 0)) && ($cnt < 3)) { + while (((strpos($GLOBALS['output'], '{--') !== false) || (strpos($GLOBALS['output'], '{!') !== false) || (strpos($GLOBALS['output'], '{?') !== false) || (strpos($GLOBALS['output'], '{%') !== false)) && ($cnt < 3)) { // Init common variables $content = array(); $newContent = ''; // Compile it - $eval = "\$newContent = \"".compileCode(escapeQuotes($GLOBALS['output']))."\";"; + //* DEBUG: */ print '
'.htmlentities($GLOBALS['output']).'
'; + $eval = '$newContent = "' . compileCode(escapeQuotes($GLOBALS['output'])) . '";'; + //* DEBUG: */ die('
'.htmlentities($eval).'
'); eval($eval); // Was that eval okay? @@ -169,6 +173,8 @@ function compileFinalOutput () { // Something went wrong! debug_report_bug('Evaluation error:
' . linenumberCode($eval) . '
', false); } // END - if + + // Use it again $GLOBALS['output'] = $newContent; // Count round @@ -1165,30 +1171,30 @@ function addSelectionBox ($type, $default, $prefix = '', $id = '0', $class = 're if ($type == 'yn') { // This is a yes/no selection only! - if ($id > 0) $prefix .= "[" . $id."]"; - $OUT .= " '; } else { // Begin with regular selection box here if (!empty($prefix)) $prefix .= "_"; $type2 = $type; - if ($id > 0) $type2 .= "[" . $id."]"; - $OUT .= " '; } switch ($type) { case 'day': // Day for ($idx = 1; $idx < 32; $idx++) { - $OUT .= "'; } // END - for break; case 'month': // Month - foreach ($GLOBALS['month_descr'] as $month => $descr) { - $OUT .= "'; } // END - for } elseif ($default == -1) { // Current year minus 1 - for ($idx = $startYear; $idx <= ($year + 1); $idx++) - { - $OUT .= "\n"; - } + for ($idx = $startYear; $idx <= ($year + 1); $idx++) { + $OUT .= ''; + } // END - for } else { // Get current year and subtract the configured minimum age - $OUT .= "\n"; + $OUT .= ''; // Calculate earliest year depending on extension version if (isExtensionInstalledAndNewer('order', '0.2.1')) { // Use configured minimum age @@ -1235,41 +1240,41 @@ function addSelectionBox ($type, $default, $prefix = '', $id = '0', $class = 're // Construct year selection list for ($idx = $minYear; $idx <= $year; $idx++) { - $OUT .= "'; } // END - for } break; case 'sec': case 'min': - for ($idx = '0'; $idx < 60; $idx+=5) { + for ($idx = 0; $idx < 60; $idx+=5) { if (strlen($idx) == 1) $idx = '0' . $idx; - $OUT .= "'; } // END - for break; case 'hour': - for ($idx = '0'; $idx < 24; $idx++) { + for ($idx = 0; $idx < 24; $idx++) { if (strlen($idx) == 1) $idx = '0' . $idx; - $OUT .= "'; } // END - for break; case 'yn': - $OUT .= "