Skip to content

fix: GET /v1/scraper/jobs/ rows parameter silently returns 0 results on non-numeric input #1116

Open

Description

@sebiboga

Problem

In GET /v1/scraper/jobs/, passing a non-numeric rows parameter silently returns 0 results:

rows=abc → (int)"abc" = 0 → min(0, 500) = 0 → Solr returns 0 docs

No error, no warning — just an empty data array.

Current code

 = isset($_GET['rows']) ? min((int)$_GET['rows'], 500) : 100;

Fix

$rowsRaw = isset($_GET['rows']) ? (int)$_GET['rows'] : 0;
$rows = ($rowsRaw > 0 && $rowsRaw <= 500) ? $rowsRaw : 100;

Impact

Low — the scraper never passes rows (uses default 100). Only affects manual testing or misbehaving clients.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions