mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[ticket/10532] Get rid of inline calculation of $start, remove duplicated check
PHPBB3-10532
This commit is contained in:
parent
8f3fba8858
commit
459e8dc095
1 changed files with 7 additions and 2 deletions
|
@ -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
|
// 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);
|
$id_ary = array_slice($id_ary, $start, $per_page);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Reference in a new issue