mirror of
https://github.com/friendica/friendica
synced 2025-04-25 09:10:11 +00:00
More parameter handling improved
This commit is contained in:
parent
6c767743d1
commit
fd4926b0f3
11 changed files with 27 additions and 32 deletions
|
@ -45,10 +45,11 @@ class Favorites extends BaseApi
|
|||
Logger::info(BaseApi::LOG_PREFIX . 'for {self}', ['module' => 'api', 'action' => 'favorites']);
|
||||
|
||||
// params
|
||||
$count = $this->getRequestValue($request, 'count', 20, 1, 100);
|
||||
$page = $this->getRequestValue($request, 'page', 1, 1);
|
||||
$since_id = $this->getRequestValue($request, 'since_id', 0, 0);
|
||||
$max_id = $this->getRequestValue($request, 'max_id', 0, 0);
|
||||
$count = $this->getRequestValue($request, 'count', 20, 1, 100);
|
||||
$page = $this->getRequestValue($request, 'page', 1, 1);
|
||||
$since_id = $this->getRequestValue($request, 'since_id', 0, 0);
|
||||
$max_id = $this->getRequestValue($request, 'max_id', 0, 0);
|
||||
$include_entities = $this->getRequestValue($request, 'include_entities', false);
|
||||
|
||||
$start = max(0, ($page - 1) * $count);
|
||||
|
||||
|
@ -64,8 +65,6 @@ class Favorites extends BaseApi
|
|||
|
||||
$statuses = Post::selectForUser($uid, [], $condition, $params);
|
||||
|
||||
$include_entities = strtolower(($request['include_entities'] ?? 'false') == 'true');
|
||||
|
||||
$ret = [];
|
||||
while ($status = DBA::fetch($statuses)) {
|
||||
$ret[] = DI::twitterStatus()->createFromUriId($status['uri-id'], $status['uid'], $include_entities)->toArray();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue