Allow underscore in order_by() function.

This commit is contained in:
Nate 2019-07-01 20:37:34 -06:00
parent 747b0ff3d8
commit 492d03a5b9
1 changed files with 1 additions and 1 deletions

View File

@ -2125,7 +2125,7 @@ function number_pad($number,$n) {
//validate and format order by clause of select statement
if (!function_exists('order_by')) {
function order_by($col, $dir) {
$col = preg_replace('#[^a-zA-Z0-9-]#', '', $col);
$col = preg_replace('#[^a-zA-Z0-9-_]#', '', $col);
$dir = strtolower($dir) == 'desc' ? 'desc' : 'asc';
if ($col != '') { return ' order by '.$col.' '.$dir.' '; }
}