diff --git a/classes/Link.php b/classes/Link.php index 0c9b58d3a..81d616857 100644 --- a/classes/Link.php +++ b/classes/Link.php @@ -124,6 +124,9 @@ class LinkCore if ($dispatcher->hasKeyword('product_rule', $id_lang, 'tags')) $params['tags'] = Tools::str2url($product->getTags($id_lang)); + + if ($dispatcher->hasKeyword('product_rule', $id_lang, 'reference')) + $params['reference'] = Tools::str2url($product->reference); if ($dispatcher->hasKeyword('product_rule', $id_lang, 'categories')) { @@ -441,7 +444,20 @@ class LinkCore $controller = Dispatcher::getInstance()->getController(); if (!empty(Context::getContext()->controller->php_self)) $controller = Context::getContext()->controller->php_self; - + + if ($controller == 'product' && isset($params['id_product'])) + return $this->getProductLink((int)$params['id_product'], null, null, null, (int)$id_lang); + elseif ($controller == 'category' && isset($params['id_category'])) + return $this->getCategoryLink((int)$params['id_category'], null, (int)$id_lang); + elseif ($controller == 'supplier' && isset($params['id_supplier'])) + return $this->getSupplierLink((int)$params['id_supplier'], null, (int)$id_lang); + elseif ($controller == 'manufacturer' && isset($params['id_manufacturer'])) + return $this->getManufacturerLink((int)$params['id_manufacturer'], null, (int)$id_lang); + elseif ($controller == 'cms' && isset($params['id_cms'])) + return $this->getCMSLink((int)$params['id_cms'], null, false, (int)$id_lang); + elseif ($controller == 'cms' && isset($params['id_cms_category'])) + return $this->getCMSCategoryLink((int)$params['id_cms_category'], null, (int)$id_lang); + return $this->getPageLink($controller, false, $id_lang, $params); } diff --git a/classes/controller/FrontController.php b/classes/controller/FrontController.php index 407e9966a..e6baef35c 100755 --- a/classes/controller/FrontController.php +++ b/classes/controller/FrontController.php @@ -644,8 +644,7 @@ class FrontControllerCore extends Controller foreach ($query as $key => $value) $params[Tools::safeOutput($key)] = Tools::safeOutput($value); } - - $excluded_key = array('isolang', 'id_lang', 'controller', 'fc'); + $excluded_key = array('isolang', 'id_lang', 'controller', 'fc', 'id_product', 'id_category', 'id_manufacturer', 'id_supplier', 'id_cms'); foreach ($_GET as $key => $value) if (!in_array($key, $excluded_key) && Validate::isUrl($key) && Validate::isUrl($value)) $params[Tools::safeOutput($key)] = Tools::safeOutput($value);