Minor fixes to statement, services and internal things
Many misc updates
This commit is contained in:
@@ -22,9 +22,9 @@ class lnApp_Sort {
|
||||
*/
|
||||
public static function MAsort(&$data,$sortby,$rev=0) {
|
||||
// if the array to sort is null or empty, or our sortby is bad
|
||||
if (! preg_match('/^[a-zA-Z0-9_]+(\([a-zA-Z0-9_,]*\))?$/',$sortby) || ! $data)
|
||||
if (! preg_match('/^([a-zA-Z0-9_]+(\([a-zA-Z0-9_,]*\)(->[a-zA-Z0-9])?)?,?)+$/',$sortby) || ! $data)
|
||||
return;
|
||||
|
||||
|
||||
$code = '$c=0;';
|
||||
|
||||
foreach (explode(',',$sortby) as $key) {
|
||||
@@ -83,7 +83,7 @@ class lnApp_Sort {
|
||||
$code .= 'return $c;';
|
||||
|
||||
$result = create_function('$a, $b',$code);
|
||||
|
||||
|
||||
uasort($data,$result);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user