Merge pull request #10869 from MrPetovan/bug/10868-mastodon-api-notifications
Ignore max_id when it's 0 or less in BaseDepository->_selectByBoundaries
This commit is contained in:
commit
e2400067a5
|
@ -87,7 +87,7 @@ abstract class BaseDepository
|
|||
}
|
||||
}
|
||||
|
||||
if (isset($max_id)) {
|
||||
if (isset($max_id) && $max_id > 0) {
|
||||
$boundCondition = DBA::mergeConditions($boundCondition, ['`id` < ?', $max_id]);
|
||||
if (!isset($min_id) && (!isset($params['order']['id']) || $params['order']['id'] === false || $params['order']['id'] === 'ASC')) {
|
||||
$reverseOrder = true;
|
||||
|
|
|
@ -124,8 +124,8 @@ class Notifications extends BaseApi
|
|||
$Notifications = DI::notification()->selectByBoundaries(
|
||||
$condition,
|
||||
$params,
|
||||
$request['min_id'] ?? null,
|
||||
$request['min_id'] ?? $request['since_id'] ?? null,
|
||||
$request['min_id'] ?: $request['since_id'],
|
||||
$request['max_id'],
|
||||
$request['limit']
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user