From 492d03a5b969ec9f36194dd9d45fa17b2c1ef5df Mon Sep 17 00:00:00 2001 From: Nate Date: Mon, 1 Jul 2019 20:37:34 -0600 Subject: [PATCH] Allow underscore in order_by() function. --- resources/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/functions.php b/resources/functions.php index 144f779131..d19e43d99f 100644 --- a/resources/functions.php +++ b/resources/functions.php @@ -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.' '; } }