aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/search.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/phpBB/search.php b/phpBB/search.php
index 87e40832a5..3006c0e5d9 100644
--- a/phpBB/search.php
+++ b/phpBB/search.php
@@ -505,10 +505,15 @@ if ($keywords || $author || $author_id || $search_id || $submit)
}
// Make sure $start is set to the last page if it exceeds the amount
- if ($start < 0 || $start >= $total_match_count)
+ if ($start < 0)
{
- $start = ($start < 0) ? 0 : floor(($total_match_count - 1) / $per_page) * $per_page;
+ $start = 0;
}
+ else if ($start >= $total_match_count)
+ {
+ $start = floor(($total_match_count - 1) / $per_page) * $per_page;
+ }
+
$id_ary = array_slice($id_ary, $start, $per_page);
}
else