Checking for underscore in SortColumn just to be sure

This commit is contained in:
Sean Harvey 2012-12-20 16:04:44 +13:00
parent 7c369a383a
commit 91548f76be

View File

@ -1236,7 +1236,7 @@ class MSSQLDatabase extends SS_Database {
// just use the function directly in the order by instead of the alias // just use the function directly in the order by instead of the alias
$selects = $query->getSelect(); $selects = $query->getSelect();
foreach($orderby as $field => $dir) { foreach($orderby as $field => $dir) {
if(preg_match('/SortColumn/', $field)) { if(preg_match('/_SortColumn/', $field)) {
unset($orderby[$field]); unset($orderby[$field]);
$orderby[$selects[str_replace('"', '', $field)]] = $dir; $orderby[$selects[str_replace('"', '', $field)]] = $dir;
} }