More fixes for redirect vs. regular output, thanks to wernisman
[mailer.git] / inc / functions.php
index 8f16dfc02a44ac1f7a4583722005bce6404b7573..95d143c2a33e1dcde41e965dd93ac032694a99c5 100644 (file)
@@ -85,7 +85,7 @@ function outputHtml ($htmlCode, $newLine = true) {
                                app_die(__FUNCTION__, __LINE__, '<strong>{--FATAL_ERROR--}:</strong> {--LANG_NO_RENDER_DIRECT--}');
                                break;
                } // END - switch
-       } elseif (getPhpCaching() == 'on') {
+       } elseif ((getPhpCaching() == 'on') && ((!isset($GLOBALS['header'])) || (count($GLOBALS['header']) == 0))) {
                // Output cached HTML code
                $GLOBALS['output'] = ob_get_contents();
 
@@ -121,6 +121,9 @@ function outputHtml ($htmlCode, $newLine = true) {
 
                // Output code here, DO NOT REMOVE! ;-)
                outputRawCode($GLOBALS['output']);
+       } else {
+               // And flush all headers
+               flushHeaders();
        }
 }
 
@@ -3829,7 +3832,6 @@ function encodeUrl ($url, $outputMode = '0') {
 
                // Add it to URL
                if (session_id() != '') {
-                       die($url);
                        $url .= $seperator . session_name() . '=' . session_id();
                } // END - if
        } // END - if