diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-07-10 15:55:10 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-07-10 15:55:10 +0000 |
commit | 4f7c52e9e385041320179dcb7d27a9217a353c71 (patch) | |
tree | bcab21e9174983a19f2c6256b36435ffb56ad080 /phpBB/viewtopic.php | |
parent | 0fa9103a0cacbe91404c32cddf0bcfe029423d04 (diff) | |
download | forums-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.php | 6 |
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&t=$topic_id&start=$start&$u_sort_param" . (($highlight_match) ? "&hilit=$highlight" : '')); |