// Context part 20
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7740 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -47,18 +47,18 @@ else
|
||||
|
||||
class Tools extends ToolsCore
|
||||
{
|
||||
|
||||
/**
|
||||
* Redirect user to another page after 5 sec
|
||||
*
|
||||
* @param string $url Desired URL
|
||||
* @param string $baseUri Base URI (optional)
|
||||
*/
|
||||
public static function redirect($url, $baseUri = __PS_BASE_URI__)
|
||||
public static function redirect($url, $baseUri = __PS_BASE_URI__, Link $link = null)
|
||||
{
|
||||
if (!$link)
|
||||
$link = Context::getContext()->link;
|
||||
if (strpos($url, 'http://') === FALSE && strpos($url, 'https://') === FALSE)
|
||||
{
|
||||
global $link;
|
||||
if (strpos($url, $baseUri) !== FALSE && strpos($url, $baseUri) == 0)
|
||||
$url = substr($url, strlen($baseUri));
|
||||
$explode = explode('?', $url);
|
||||
@@ -73,7 +73,6 @@ class Tools extends ToolsCore
|
||||
else
|
||||
header('Refresh: 5; url='.$baseUri.$url);
|
||||
exit;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user