diff --git a/src/BaseDepository.php b/src/BaseDepository.php index 69bd93eef..75118dd8c 100644 --- a/src/BaseDepository.php +++ b/src/BaseDepository.php @@ -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; diff --git a/src/Module/Api/Mastodon/Notifications.php b/src/Module/Api/Mastodon/Notifications.php index 28166e6ed..a6a024d9b 100644 --- a/src/Module/Api/Mastodon/Notifications.php +++ b/src/Module/Api/Mastodon/Notifications.php @@ -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'] );