From ff13e58f8f22aa1ec97add5fd08b068d59293364 Mon Sep 17 00:00:00 2001 From: Shish Date: Sat, 26 Sep 2015 20:03:30 +0100 Subject: [PATCH] clamp to a valid value --- ext/comment/main.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/comment/main.php b/ext/comment/main.php index b21e701e..08b50684 100644 --- a/ext/comment/main.php +++ b/ext/comment/main.php @@ -352,7 +352,8 @@ class CommentList extends Extension { ") / 10); $database->cache->set("comment_pages", $total_pages, 600); } - + $total_pages = max($total_pages, 1); + $current_page = clamp($current_page, 1, $total_pages); $threads_per_page = 10;