mirror of
https://github.com/pi-hole/web.git
synced 2025-12-24 04:38:28 +00:00
Fix IP sorting when there are empty fields present.
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -5,12 +5,18 @@
|
||||
* This file is copyright under the latest version of the EUPL.
|
||||
* Please see LICENSE file for your rights under this license. */
|
||||
|
||||
// This code has been taken from
|
||||
// The original ip-sorting code has been taken from
|
||||
// https://datatables.net/plug-ins/sorting/ip-address
|
||||
// and was modified by the Pi-hole team to support
|
||||
// CIDR notation and be more robust against invalid
|
||||
// input data (like empty IP addresses)
|
||||
|
||||
jQuery.extend(jQuery.fn.dataTableExt.oSort, {
|
||||
"ip-address-pre": function (a) {
|
||||
if (!a) {
|
||||
return 0;
|
||||
// Skip empty fields (IP address might have expired or
|
||||
// reassigned to a differenct device)
|
||||
if (!a || a.length === 0) {
|
||||
return Infinity;
|
||||
}
|
||||
|
||||
var i, item;
|
||||
|
||||
Reference in New Issue
Block a user