summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/tablesort.inc12
1 files changed, 6 insertions, 6 deletions
diff --git a/includes/tablesort.inc b/includes/tablesort.inc
index 382014fa8..e6a7b785a 100644
--- a/includes/tablesort.inc
+++ b/includes/tablesort.inc
@@ -23,8 +23,13 @@ class TableSort extends SelectQueryExtender {
protected $header = array();
public function execute() {
+ return $this->query->execute();
+ }
+
+ public function orderByHeader(Array $header) {
+ $this->header = $header;
$ts = $this->init();
- if ($ts['sql']) {
+ if (!empty($ts['sql'])) {
// Based on code from db_escape_table(), but this can also contain a dot.
$field = preg_replace('/[^A-Za-z0-9_.]+/', '', $ts['sql']);
@@ -33,11 +38,6 @@ class TableSort extends SelectQueryExtender {
$sort = in_array($sort, array('ASC', 'DESC')) ? $sort : '';
$this->orderBy($field, $sort);
}
- return $this->query->execute();
- }
-
- public function setHeader(Array $header) {
- $this->header = $header;
return $this;
}