Always reset cache and output-mode must be 'raw' to make redirects working
authorRoland Häder <roland@mxchange.org>
Wed, 9 Nov 2011 07:15:45 +0000 (07:15 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 9 Nov 2011 07:15:45 +0000 (07:15 +0000)
inc/functions.php
inc/wrapper-functions.php

index e768c7e02e630b837283730f0b28c489beb825e6..4e1579b587836adbddf46bb27cda9bff22311569 100644 (file)
@@ -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('&amp;', '&', $url), false));
        } else {
index 64ef91e97eab10b77805853a904dd609bf0d4715..8c0836316486a227df6a3822639ac01baf771a84 100644 (file)
@@ -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