1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-02 12:48:26 +02:00

Redirect no-cache option

This commit is contained in:
SecretR
2013-10-06 18:03:15 +03:00
parent 213e438f23
commit 055b26ac5c

View File

@@ -306,9 +306,9 @@ class redirection
} }
public function redirect($url, $replace = TRUE, $http_response_code = NULL) public function redirect($url, $replace = TRUE, $http_response_code = NULL, $preventCache)
{ {
return $this->go($url, $replace, $http_response_code); return $this->go($url, $replace, $http_response_code, $preventCache);
} }
@@ -318,14 +318,20 @@ class redirection
* @param string $url * @param string $url
* @param boolean $replace - default TRUE * @param boolean $replace - default TRUE
* @param integer|null $http_response_code - default NULL * @param integer|null $http_response_code - default NULL
* @param boolean $preventCache
* @return void * @return void
*/ */
public function go($url, $replace = TRUE, $http_response_code = NULL) public function go($url, $replace = TRUE, $http_response_code = NULL, $preventCache = true)
{ {
if(session_id()) if(session_id())
{ {
e107::getSession()->end(); e107::getSession()->end();
} }
if($preventCache)
{
header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0', true);
header('Expires: Sat, 26 Jul 1997 05:00:00 GMT', true);
}
if(null === $http_response_code) if(null === $http_response_code)
{ {
header('Location: '.$url, $replace); header('Location: '.$url, $replace);