Update ApiV1Controller, handle public feed parameter bug to gracefully fallback to min_id=1 when max_id=0

This commit is contained in:
Daniel Supernault 2024-03-05 04:43:21 -07:00
parent d6eac65555
commit e3826c587d
No known key found for this signature in database
GPG Key ID: 23740873EE6F76A1
1 changed files with 3 additions and 0 deletions

View File

@ -2627,6 +2627,9 @@ class ApiV1Controller extends Controller
$napi = $request->has(self::PF_API_ENTITY_KEY);
$min = $request->input('min_id');
$max = $request->input('max_id');
if ($max == 0) {
$min = 1;
}
$minOrMax = $request->anyFilled(['max_id', 'min_id']);
$limit = $request->input('limit') ?? 20;
if ($limit > 40) {