diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index aa184d885..01f069f44 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -2189,8 +2189,10 @@ class AdminControllerCore extends Controller if (preg_match('/[.!]/', $order_by)) { $order_by_split = preg_split('/[.!]/', $order_by); - $order_by = pSQL($order_by_split[0]).'.`'.pSQL($order_by_split[1]).'`'; + $order_by = bqSQL($order_by_split[0]).'.`'.bqSQL($order_by_split[1]).'`'; } + elseif ($order_by) + $order_by = '`'.bqSQL($order_by).'`'; $this->_orderWay = Tools::strtoupper($order_way); @@ -2284,7 +2286,7 @@ class AdminControllerCore extends Controller (isset($this->_filter) ? $this->_filter : '').$where_shop.' '.(isset($this->_group) ? $this->_group.' ' : '').' '.$having_clause.' - ORDER BY '.(($order_by == $this->identifier) ? 'a.' : '').'`'.pSQL($order_by).'` '.pSQL($order_way). + ORDER BY '.(($order_by == $this->identifier) ? 'a.' : '').$order_by.' '.pSQL($order_way). ($this->_tmpTableFilter ? ') tmpTable WHERE 1'.$this->_tmpTableFilter : ''). (($use_limit === true) ? ' LIMIT '.(int)$start.','.(int)$limit : '');