[-] BO : FixBug #PSCFV-9329 Alias problem in order by
This commit is contained in:
@@ -592,7 +592,7 @@ class ValidateCore
|
|||||||
*/
|
*/
|
||||||
public static function isOrderBy($order)
|
public static function isOrderBy($order)
|
||||||
{
|
{
|
||||||
return preg_match('/^[a-zA-Z0-9._-]+$/', $order);
|
return preg_match('/^[a-zA-Z0-9.!_-]+$/', $order);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -2149,15 +2149,14 @@ class AdminControllerCore extends Controller
|
|||||||
|
|
||||||
/* Cache */
|
/* Cache */
|
||||||
$this->_lang = (int)$id_lang;
|
$this->_lang = (int)$id_lang;
|
||||||
|
$this->_orderBy = $order_by;
|
||||||
|
|
||||||
if (preg_match('/[.!]/', $order_by))
|
if (preg_match('/[.!]/', $order_by))
|
||||||
{
|
{
|
||||||
$order_by_split = preg_split('/[.!]/', $order_by);
|
$order_by_split = preg_split('/[.!]/', $order_by);
|
||||||
$order_by = pSQL($order_by_split[0]).'.`'.pSQL($order_by_split[1]).'`';
|
$order_by = pSQL($order_by_split[0]).'.`'.pSQL($order_by_split[1]).'`';
|
||||||
$this->_orderBy = (isset($order_by_split) && isset($order_by_split[1])) ? $order_by_split[1] : $order_by;
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
$this->_orderBy = $order_by;
|
|
||||||
$this->_orderWay = Tools::strtoupper($order_way);
|
$this->_orderWay = Tools::strtoupper($order_way);
|
||||||
|
|
||||||
/* SQL table : orders, but class name is Order */
|
/* SQL table : orders, but class name is Order */
|
||||||
|
|||||||
Reference in New Issue
Block a user