From 66ec59e0f4179e2ab5630bb00bf20ba3fdab5ba6 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Fri, 15 Oct 2010 04:34:15 +0000 Subject: #664042 by coltrane, effulgentsia: Fixed TableSort order error when no sort set in header --- includes/tablesort.inc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'includes') diff --git a/includes/tablesort.inc b/includes/tablesort.inc index cd0136bc1..960bd2f0d 100644 --- a/includes/tablesort.inc +++ b/includes/tablesort.inc @@ -128,12 +128,14 @@ class TableSort extends SelectQueryExtender { } else { // The first column specified is initial 'order by' field unless otherwise specified - if (is_array($this->header[0])) { - $this->header[0] += array('data' => NULL, 'field' => NULL); - return array('name' => $this->header[0]['data'], 'sql' => $this->header[0]['field']); + $headers = array_values($this->header); + $header = $headers[0]; + if (is_array($header)) { + $header += array('data' => NULL, 'field' => NULL); + return array('name' => $header['data'], 'sql' => $header['field']); } else { - return array('name' => $this->header[0]); + return array('name' => $header); } } } -- cgit v1.2.3