mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 04:10:38 +02:00
Redirect no-cache option
This commit is contained in:
@@ -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 boolean $replace - default TRUE
|
||||
* @param integer|null $http_response_code - default NULL
|
||||
* @param boolean $preventCache
|
||||
* @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())
|
||||
{
|
||||
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)
|
||||
{
|
||||
header('Location: '.$url, $replace);
|
||||
|
Reference in New Issue
Block a user