Browse Source

Fixing table with no columns see BT#8048

Julio Montoya 11 years ago
parent
commit
ec798ab1ae
1 changed files with 3 additions and 2 deletions
  1. 3 2
      main/inc/lib/table_sort.class.php

+ 3 - 2
main/inc/lib/table_sort.class.php

@@ -103,6 +103,7 @@ class TableSort
             // Probably an attack
             return $data;
         }
+
         if (!in_array($direction, array(SORT_ASC, SORT_DESC))) {
             // Probably an attack
             return $data;
@@ -197,7 +198,8 @@ class TableSort
             usort($data, create_function('$a, $b', $compare_function));
         }
 
-		if (is_array($column_show)) {
+		if (is_array($column_show) && !empty($column_show)) {
+
 			// We show only the columns data that were set up on the $column_show array
 			$new_order_data = array();
 			$count_data = count($data);
@@ -214,7 +216,6 @@ class TableSort
 			// Replace the multi-arrays
 			$data = $new_order_data;
 		}
-
 		return $data;
 	}