diff --git a/core/PaginatedList.php b/core/PaginatedList.php index 2d07f82d260..a332f57c843 100644 --- a/core/PaginatedList.php +++ b/core/PaginatedList.php @@ -293,6 +293,7 @@ public function PaginationSummary($context = 4) { } $left = max($current - $offset, 1); + $right = min($current + $offset, $total); $range = range($current - $offset, $current + $offset); if ($left + $context > $total) { @@ -304,7 +305,7 @@ public function PaginationSummary($context = 4) { $num = $i + 1; $emptyRange = $num != 1 && $num != $total && ( - $num == $left - 1 || $num == $left + $context + 1 + $num == $left - 1 || $num == $right + 1 ); if ($emptyRange) {