From 40ad095ca1998aa741f2bbc0dbab8ec16dff3d1f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 9 Nov 2011 07:19:36 +0000 Subject: [PATCH] Better encapsulate this a little ... --- inc/functions.php | 9 --------- inc/wrapper-functions.php | 9 +++++++++ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/inc/functions.php b/inc/functions.php index 4e1579b587..90f2b6d378 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -564,15 +564,6 @@ function redirectToUrl ($url, $allowSpider = true) { // We should not sent a redirect if headers are already sent if (!headers_sent()) { - // Clear output buffer - clearOutputBuffer(); - - // 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 8c08363164..c86787ebc2 100644 --- a/inc/wrapper-functions.php +++ b/inc/wrapper-functions.php @@ -1108,6 +1108,15 @@ function getHttpStatus () { * @access private */ function sendRawRedirect ($url) { + // Clear output buffer + clearOutputBuffer(); + + // Clear own output buffer + $GLOBALS['output'] = ''; + + // To make redirects working (no content type), output mode must be raw + setOutputMode(-1); + // Send helping header setHttpStatus('302 Found'); -- 2.39.5