From: quix0r Date: Wed, 9 Nov 2011 07:15:45 +0000 (+0000) Subject: Always reset cache and output-mode must be 'raw' to make redirects working X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a5c2e88de7f58e9a0d25843cda96f30e9d8232ff;p=mailer.git Always reset cache and output-mode must be 'raw' to make redirects working --- diff --git a/inc/functions.php b/inc/functions.php index e768c7e02e..4e1579b587 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -570,6 +570,9 @@ function redirectToUrl ($url, $allowSpider = true) { // Clear own output buffer $GLOBALS['output'] = ''; + // To make redirects working (no content type), output mode must be raw + setOutputMode(-1); + // Load URL when headers are not sent sendRawRedirect(doFinalCompilation(str_replace('&', '&', $url), false)); } else { diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php index 64ef91e97e..8c08363164 100644 --- a/inc/wrapper-functions.php +++ b/inc/wrapper-functions.php @@ -677,7 +677,9 @@ function getScriptOutputMode () { // Setter for 'output_mode' value function setOutputMode ($newOutputMode) { - $GLOBALS['output_mode'] = (int) $newOutputMode; + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'output_mode=' . $newOutputMode); + $GLOBALS['output_mode'] = (int) $newOutputMode; + $GLOBALS['getScriptOutputMode'] = (int) $newOutputMode; } // Checks wether output_mode is set and optionally aborts on miss