|
@@ -2124,7 +2124,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, $col_default = '') {
|
|
|
|
|
|
+ function order_by($col, $dir, $col_default = '', $dir_default = 'asc') {
|
|
$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.' '; }
|