From 8abaef5884f16fb899a9409ad34b16c9f151081e Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 7 May 2015 16:54:14 +0930 Subject: [PATCH] Actually use the calculated offset --- framework/core/src/Api/Actions/Posts/GetsPosts.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/framework/core/src/Api/Actions/Posts/GetsPosts.php b/framework/core/src/Api/Actions/Posts/GetsPosts.php index be99bcf9f..ae19b910a 100644 --- a/framework/core/src/Api/Actions/Posts/GetsPosts.php +++ b/framework/core/src/Api/Actions/Posts/GetsPosts.php @@ -9,10 +9,10 @@ trait GetsPosts $user = $request->actor->getUser(); if (isset($where['discussion_id']) && ($near = $request->get('near')) > 1) { - $start = $this->posts->getIndexForNumber($where['discussion_id'], $near, $user); - $start = max(0, $request->offset - $request->limit / 2); + $offset = $this->posts->getIndexForNumber($where['discussion_id'], $near, $user); + $offset = max(0, $offset - $request->limit / 2); } else { - $start = 0; + $offset = 0; } return $this->posts->findWhere( @@ -20,7 +20,7 @@ trait GetsPosts $user, $request->sort, $request->limit, - $request->offset + $offset ); } }