aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/search.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2012-02-26 02:15:39 +0100
committerAndreas Fischer <bantu@phpbb.com>2012-02-26 02:15:39 +0100
commit459e8dc09522d8e54ce82182a99ebddf2362a737 (patch)
tree089e2a19989040dc934a82cc82e8ed5181f5f4fd /phpBB/search.php
parent8f3fba885859e00646531632558d75b609ecf813 (diff)
downloadforums-459e8dc09522d8e54ce82182a99ebddf2362a737.tar
forums-459e8dc09522d8e54ce82182a99ebddf2362a737.tar.gz
forums-459e8dc09522d8e54ce82182a99ebddf2362a737.tar.bz2
forums-459e8dc09522d8e54ce82182a99ebddf2362a737.tar.xz
forums-459e8dc09522d8e54ce82182a99ebddf2362a737.zip
[ticket/10532] Get rid of inline calculation of $start, remove duplicated check
PHPBB3-10532
Diffstat (limited to 'phpBB/search.php')
-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