From b822c9bb96f24c045e2d5553415f5e20e008402b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 9 Nov 2011 07:15:45 +0000 Subject: [PATCH] Always reset cache and output-mode must be 'raw' to make redirects working --- inc/functions.php | 3 +++ inc/wrapper-functions.php | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) 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 -- 2.39.5