diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 2a1645a5e0..255fccd56f 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -380,15 +380,24 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add
if($this_block_end < $total_pages)
{
$page_string_append = ", ";
- for($i = $this_block_end + 1; $i < $total_pages; $i+=10)
+
+ if(!($total_pages%10))
{
- $page_string_append .= "" . ( ($i == 0) ? ($i+1) : $i) . " - " . ((($i+9) < $total_pages) ? ($i+9) : $total_pages) ."";
- if($i < $total_pages - 10)
+ $page_url = append_sid($base_url."&start=".( ( ($this_block_end + 1) * $per_page ) - $per_page ) );
+ $page_string_append .= "$total_pages";
+ }
+ else
+ {
+
+ for($i = $this_block_end + 1; $i < $total_pages; $i+=10)
{
- $page_string_append .= ", ";
+ $page_string_append .= "" . ( ($i == 0) ? ($i+1) : $i) . " - " . ((($i+9) < $total_pages) ? ($i+9) : $total_pages) ."";
+ if($i < $total_pages - 10)
+ {
+ $page_string_append .= ", ";
+ }
}
}
-
$page_string .= $page_string_append;
}