[-] FO : #PSCFV-2951 - Fix bug with dispatcher and route rule with multilanguage

This commit is contained in:
mDeflotte
2012-07-02 14:16:47 +00:00
parent 1e9e36ffd7
commit 3db6a38f1e
4 changed files with 138 additions and 91 deletions
+16 -1
View File
@@ -378,6 +378,9 @@ class ToolsCore
if (!$context)
$context = Context::getContext();
if (($iso = Tools::getValue('isolang')) && Validate::isLanguageIsoCode($iso) && ($id_lang = (int)Language::getIdByIso($iso)))
$_GET['id_lang'] = $id_lang;
// update language only if new id is different from old id
// or if default language changed
$cookie_id_lang = $context->cookie->id_lang;
@@ -392,7 +395,19 @@ class ToolsCore
$params = $_GET;
unset($params['id_lang']);
Tools::redirect('index.php?'.http_build_query($params));
if (!Configuration::get('PS_REWRITING_SETTINGS'))
{
if (empty($params['controller']))
unset($params['controller']);
elseif (!empty(Context::getContext()->controller->php_self))
$params['controller'] = Context::getContext()->controller->php_self;
if (empty($params))
Tools::redirect('index.php');
else
Tools::redirect('index.php?'.http_build_query($params));
}
}
}