Skip to content

Commit 5355f40

Browse files
committed
Make sorting more robust
1 parent f65c8ec commit 5355f40

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

functions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ function parsestatoutput($output, $title, $sessionid) {
766766

767767
$x = 1;
768768
foreach ($columns as $column) {
769-
$o .= "<th class='subHeaderColumn" . ($column == 'Bytes' ? ' {sorter: "bytes"}':'') . "' style='text-align:" . get_column_alignment($column) . "'>$column</th>";
769+
$o .= "<th class='subHeaderColumn" . (preg_match('/(Bytes|Flows|Packets)/i', $column) ? ' {sorter: "bytes"}':'') . "' style='text-align:" . get_column_alignment($column) . "'>$column</th>";
770770
$x++;
771771
}
772772
$o .= '</tr></thead><tbody>';
@@ -919,7 +919,7 @@ function parseprintoutput($output, $title, $sessionid) {
919919
}
920920

921921
foreach ($columns as $column) {
922-
$o .= "<th class='subHeaderColumn" . ($column == 'Bytes' ? ' {sorter: "bytes"}':'') . "' style='text-align:" . get_column_alignment($column) . "'>$column</th>";
922+
$o .= "<th class='subHeaderColumn" . (preg_match('/(Bytes|Flows|Packets)/i', $column) ? ' {sorter: "bytes"}':'') . "' style='text-align:" . get_column_alignment($column) . "'>$column</th>";
923923
}
924924

925925
$o .= '</tr></thead><tbody>';

0 commit comments

Comments
 (0)