From 2e58abf91cdef694fcca7a14a2c0a00153d2eb17 Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Fri, 29 Apr 2016 21:01:30 +0200 Subject: [PATCH] Added forgotten changes. --- CRM/Core/Page/AJAX.php | 4 ++-- CRM/Utils/Sort.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CRM/Core/Page/AJAX.php b/CRM/Core/Page/AJAX.php index d99e2b19ac..7c4537eecd 100644 --- a/CRM/Core/Page/AJAX.php +++ b/CRM/Core/Page/AJAX.php @@ -221,7 +221,7 @@ class CRM_Core_Page_AJAX { $sortMapper = array(); foreach ($_GET['columns'] as $key => $value) { - $sortMapper[$key] = CRM_Utils_Type::escape($value['data'], 'MysqlColumnName'); + $sortMapper[$key] = CRM_Utils_Type::validate($value['data'], 'MysqlColumnName'); }; $offset = isset($_GET['start']) ? CRM_Utils_Type::validate($_GET['start'], 'Integer') : $defaultOffset; @@ -231,7 +231,7 @@ class CRM_Core_Page_AJAX { $sortOrder = isset($_GET['order'][0]['dir']) ? CRM_Utils_Type::validate($_GET['order'][0]['dir'], 'MysqlOrderByDirection') : $defaultsortOrder; if ($sort) { - $params['sortBy'] = "`{$sort}` {$sortOrder}"; + $params['sortBy'] = "{$sort} {$sortOrder}"; $params['_raw_values']['sort'][0] = $sort; $params['_raw_values']['order'][0] = $sortOrder; diff --git a/CRM/Utils/Sort.php b/CRM/Utils/Sort.php index 789dba32d6..e20e75d442 100644 --- a/CRM/Utils/Sort.php +++ b/CRM/Utils/Sort.php @@ -152,11 +152,11 @@ class CRM_Utils_Sort { $this->_vars[$this->_currentSortID]['direction'] == self::DONTCARE ) { $this->_vars[$this->_currentSortID]['name'] = str_replace(' ', '_', $this->_vars[$this->_currentSortID]['name']); - return CRM_Utils_Type::validate($this->_vars[$this->_currentSortID]['name'], 'MysqlColumnName') . ' asc'; + return CRM_Utils_Type::escape($this->_vars[$this->_currentSortID]['name'], 'MysqlColumnName') . ' asc'; } else { $this->_vars[$this->_currentSortID]['name'] = str_replace(' ', '_', $this->_vars[$this->_currentSortID]['name']); - return CRM_Utils_Type::validate($this->_vars[$this->_currentSortID]['name'], 'MysqlColumnName') . ' desc'; + return CRM_Utils_Type::escape($this->_vars[$this->_currentSortID]['name'], 'MysqlColumnName') . ' desc'; } } -- 2.25.1