From 2e84ae5b356584d11be344ba3e337280ed9cdd1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Chapron?= Date: Mon, 1 Apr 2019 14:57:17 +0200 Subject: [PATCH] fix(ui): replace the lastPage array with a string for the pagination filters --- www/include/common/pagination.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/www/include/common/pagination.php b/www/include/common/pagination.php index 05a51178978..1443d5fa93f 100644 --- a/www/include/common/pagination.php +++ b/www/include/common/pagination.php @@ -45,10 +45,8 @@ $type = $_REQUEST["type"] ?? null; $o = $_GET["o"] ?? $o = null; -// splitting the path ($url) to keep only the current page's filename -$currentPage = (explode('/', $url)); - -if (isset($centreon->historyLastPage) && $centreon->historyLastPage !== $currentPage) { +// checking if the current page and the last displayed page are the same +if (isset($centreon->historyLastPage) && $centreon->historyLastPage !== $url) { $num = 0; } elseif (isset($_REQUEST['num'])) { $num = filter_var( @@ -59,10 +57,9 @@ $num = $centreon->historyPage[$url] ?? 0; } -//saving current pagination filter value +//saving current pagination filter value and current displayed page $centreon->historyPage[$url] = $num; -//saving current page's file name -$centreon->historyLastPage = $currentPage; +$centreon->historyLastPage = $url; $num = addslashes($num);