aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/viewtopic.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-07-10 15:55:10 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-07-10 15:55:10 +0000
commit4f7c52e9e385041320179dcb7d27a9217a353c71 (patch)
treebcab21e9174983a19f2c6256b36435ffb56ad080 /phpBB/viewtopic.php
parent0fa9103a0cacbe91404c32cddf0bcfe029423d04 (diff)
downloadforums-4f7c52e9e385041320179dcb7d27a9217a353c71.tar
forums-4f7c52e9e385041320179dcb7d27a9217a353c71.tar.gz
forums-4f7c52e9e385041320179dcb7d27a9217a353c71.tar.bz2
forums-4f7c52e9e385041320179dcb7d27a9217a353c71.tar.xz
forums-4f7c52e9e385041320179dcb7d27a9217a353c71.zip
fix some bugs... again. :)
git-svn-id: file:///svn/phpbb/trunk@6165 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/viewtopic.php')
-rw-r--r--phpBB/viewtopic.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 4a8570f762..ccc17c7f6e 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -390,6 +390,12 @@ if ($hilit_words)
$highlight = urlencode($hilit_words);
}
+// Make sure $start is set to the last page if it exceeds the amount
+if ($start < 0 || $start > $total_posts)
+{
+ $start = ($start < 0) ? 0 : floor(($total_posts - 1) / $config['posts_per_page']) * $config['posts_per_page'];
+}
+
// General Viewtopic URL for return links
$viewtopic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;start=$start&amp;$u_sort_param" . (($highlight_match) ? "&amp;hilit=$highlight" : ''));