Skip to content

Commit

Permalink
Handle backticks in matches sort fields. Fixes regression in 1.34.17
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac Connor committed Aug 6, 2020
1 parent 302189a commit 3242ce6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web/ajax/status.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 3242ce6

Please sign in to comment.