浏览代码

Allow underscore in order_by() function.

Nate 6 年之前
父节点
当前提交
6deb5df147
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      resources/functions.php

+ 1 - 1
resources/functions.php

@@ -2125,7 +2125,7 @@ function number_pad($number,$n) {
 //validate and format order by clause of select statement
 //validate and format order by clause of select statement
 	if (!function_exists('order_by')) {
 	if (!function_exists('order_by')) {
 		function order_by($col, $dir) {
 		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';
 			$dir = strtolower($dir) == 'desc' ? 'desc' : 'asc';
 			if ($col != '') { return ' order by '.$col.' '.$dir.' '; }
 			if ($col != '') { return ' order by '.$col.' '.$dir.' '; }
 		}
 		}