diff options
Diffstat (limited to 'includes')
-rw-r--r-- | includes/tablesort.inc | 10 |
1 files changed, 6 insertions, 4 deletions
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); } } } |