Merge branch 'webkul:develop' into gli-1660
This commit is contained in:
@@ -884,7 +884,7 @@ class AdminControllerCore extends Controller
|
||||
$key = isset($tmp_tab[1]) ? $tmp_tab[0].'.`'.$tmp_tab[1].'`' : '`'.$tmp_tab[0].'`';
|
||||
|
||||
// as in database 0 means position 1 in the renderlist
|
||||
if (isset($field['position'])) {
|
||||
if (isset($field['position']) && Validate::isInt($value)) {
|
||||
$value -= 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -917,8 +917,16 @@ class FrontControllerCore extends Controller
|
||||
}
|
||||
$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);
|
||||
if (!in_array($key, $excluded_key)) {
|
||||
if (is_array($value)) {
|
||||
if (Validate::isUrl($key)) {
|
||||
$params[Tools::safeOutput($key)] = $this->sanitizeQueryOutput($value);
|
||||
}
|
||||
} else {
|
||||
if (Validate::isUrl($key) && Validate::isUrl($value)) {
|
||||
$params[Tools::safeOutput($key)] = Tools::safeOutput($value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -943,6 +951,24 @@ class FrontControllerCore extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
protected function sanitizeQueryOutput($query)
|
||||
{
|
||||
$params = array();
|
||||
foreach ($query as $key => $value) {
|
||||
if (Validate::isUrl($key)) {
|
||||
if (is_array($value)) {
|
||||
$params[Tools::safeOutput($key)] = $this->sanitizeQueryOutput($value);
|
||||
} else {
|
||||
if (Validate::isUrl($value)) {
|
||||
$params[Tools::safeOutput($key)] = Tools::safeOutput($value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $params;
|
||||
}
|
||||
|
||||
/**
|
||||
* Geolocation management
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user