mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 14:00:31 +02:00
[ticket/10532] Get rid of inline calculation of $start, remove duplicated check
PHPBB3-10532
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user