More fixes for redirect vs. regular output, thanks to wernisman
[mailer.git] / inc / functions.php
index d6a9cb65eb4a910efe4db53dd2c17190e2c2a2ac..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();
        }
 }