- foreach ($_GET['columns'] as $key => $value) {
- $sortMapper[$key] = CRM_Utils_Type::escape($value['data'], 'MysqlColumnName');
- };
+ if (isset($_GET['columns'])) {
+ foreach ($_GET['columns'] as $key => $value) {
+ $sortMapper[$key] = CRM_Utils_Type::validate($value['data'], 'MysqlColumnNameOrAlias');
+ };
+ }