Handle backticks in matches sort fields. Fixes regression in 1.34.17

This commit is contained in:
Isaac Connor 2020-08-06 10:37:56 -04:00
parent 302189a65e
commit 3242ce6ec9
1 changed files with 1 additions and 1 deletions

View File

@ -285,7 +285,7 @@ function collectData() {
preg_match('/^(\w+)\s*(ASC|DESC)?( NULLS FIRST)?$/i', $sort_field, $matches);
if ( count($matches) ) {
if ( in_array($matches[1], $fieldSql) ) {
if ( in_array($matches[1], $fieldSql) or in_array('`'.$matches[1].'`', $fieldSql) ) {
$sql .= $matches[1];
} else {
ZM\Error('Sort field ' . $matches[1] . ' not in SQL Fields');