From 816790ce4e508bb4ea214544e18559e3f974322c Mon Sep 17 00:00:00 2001 From: Mark Schouten Date: Mon, 30 Jun 2014 15:17:08 +0200 Subject: [PATCH] Fix splicing the right way --- includes/misc.inc.php | 2 +- zones.php | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/includes/misc.inc.php b/includes/misc.inc.php index 6c6cbde..d1a7542 100644 --- a/includes/misc.inc.php +++ b/includes/misc.inc.php @@ -71,7 +71,7 @@ function jtable_respond($records, $method = 'multiple', $msg = 'Undefined errorm } else { if (isset($_GET['jtPageSize'])) { $jTableResult['TotalRecordCount'] = count($records); - $records = array_slice($records, $_GET['jtStartIndex']*$_GET['jtPageSize'], $_GET['jtPageSize']); + $records = array_slice($records, $_GET['jtStartIndex'], $_GET['jtPageSize']); } $jTableResult['Result'] = "OK"; $jTableResult['Records'] = $records; diff --git a/zones.php b/zones.php index 592419e..3b7850c 100644 --- a/zones.php +++ b/zones.php @@ -194,9 +194,6 @@ if ($action == "list" or $action== "listslaves") { } } usort($return, "zonesort"); - if (isset($_GET['jtStartIndex']) and isset($_GET['jtPageSize'])) { - jtable_respond(array_slice($return, $_GET['jtStartIndex'], $_GET['jtPageSize'])); - } jtable_respond($return); } elseif ($action == "create") { if (_valid_label($_POST['name']) === FALSE) {