From 1ffc196e30b5304dab3a6a7da8300b32cb2d81ac Mon Sep 17 00:00:00 2001 From: SamBrishes Date: Fri, 12 Jun 2020 18:15:05 +0200 Subject: [PATCH] Fix Issue #1208 Fix Issue #1208 --- bl-plugins/search/plugin.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bl-plugins/search/plugin.php b/bl-plugins/search/plugin.php index 9985fcae..807075d4 100644 --- a/bl-plugins/search/plugin.php +++ b/bl-plugins/search/plugin.php @@ -131,9 +131,15 @@ EOF; // The first page number is 1, so the real is 0 $realPageNumber = $url->pageNumber() - 1; $itemsPerPage = $site->itemsPerPage(); - $chunks = array_chunk($list, $itemsPerPage); - if (isset($chunks[$realPageNumber])) { - $this->pagesFound = $chunks[$realPageNumber]; + if($itemsPerPage <= 0) { + if($realPageNumber === 0) { + $this->pagesFound = $list; + } + } else { + $chunks = array_chunk($list, $itemsPerPage); + if (isset($chunks[$realPageNumber])) { + $this->pagesFound = $chunks[$realPageNumber]; + } } } }