// 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:
tDidierjean
2011-07-26 15:55:04 +00:00
parent fddc7a6a75
commit 51b4c8591d
10 changed files with 72 additions and 73 deletions
+4 -4
View File
@@ -55,10 +55,10 @@ class ToolsCore
* @param string $url Desired URL
* @param string $baseUri Base URI (optional)
*/
public static function redirect($url, $baseUri = __PS_BASE_URI__, Context $context = null)
public static function redirect($url, $baseUri = __PS_BASE_URI__, Link $link = null)
{
if (!$context)
$context = Context::getContext();
if (!$link)
$link = Context::getContext()->link;
if (strpos($url, 'http://') === FALSE && strpos($url, 'https://') === FALSE)
{
if (strpos($url, $baseUri) !== FALSE && strpos($url, $baseUri) == 0)
@@ -70,7 +70,7 @@ class ToolsCore
}
$explode = explode('?', $url);
$url = $context->link->getPageLink($explode[0], true);
$url = $link->getPageLink($explode[0], true);
if (isset($explode[1]))
$url .= '?'.$explode[1];
$baseUri = '';