Skip to content

Commit

Permalink
QA Fixing #5515 - Sorting by hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
TheWitness committed Sep 30, 2023
1 parent ff7064a commit 699c53a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/html_utility.php
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ function update_order_string($inplace = false) {
$_SESSION['sort_string'][$page] = 'ORDER BY ';

foreach ($_SESSION['sort_data'][$page] as $column => $direction) {
if ($column == 'hostname' || $column == 'ip' || $column == 'ip_address') {
if ($column == 'ip' || $column == 'ip_address') {
$order .= ($order != '' ? ', ':'') . 'INET_ATON(' . $column . ') ' . $direction;
} else {
$order .= ($order != '' ? ', ':'') . $column . ' ' . $direction;
Expand All @@ -850,7 +850,7 @@ function update_order_string($inplace = false) {
$column = get_request_var('sort_column');
$direction = get_request_var('sort_direction');

if ($column == 'hostname' || $column == 'ip' || $column == 'ip_address') {
if ($column == 'ip' || $column == 'ip_address') {
$_SESSION['sort_string'][$page] ='ORDER BY INET_ATON(' . $column . ') ' . $direction;
} else {
$_SESSION['sort_string'][$page] = 'ORDER BY ' . $del . implode($del . '.'. $del, explode('.', get_request_var('sort_column'))) . $del . ' ' . get_request_var('sort_direction');
Expand Down

0 comments on commit 699c53a

Please sign in to comment.