1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 16:52:41 +01:00

Fix paging for 'before ID' queries

Test Plan: https://secure.phabricator.com/paste/filter/all/?before=157 - 158 is missing.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Koolvin

Differential Revision: https://secure.phabricator.com/D2330
This commit is contained in:
vrana 2012-04-27 15:54:34 -07:00
parent 2bdde748d9
commit 11ffed7cfc

View file

@ -87,7 +87,8 @@ final class AphrontIDPagerView extends AphrontView {
final public function sliceResults(array $results) {
if (count($results) > $this->getPageSize()) {
$results = array_slice($results, 0, $this->getPageSize(), true);
$offset = ($this->beforeID ? count($results) - $this->getPageSize() : 0);
$results = array_slice($results, $offset, $this->getPageSize(), true);
}
return $results;
}