From: Roland Häder Date: Wed, 9 Nov 2011 07:19:36 +0000 (+0000) Subject: Better encapsulate this a little ... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=40ad095ca1998aa741f2bbc0dbab8ec16dff3d1f;p=mailer.git Better encapsulate this a little ... --- 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');