Skip to content

fix(doctrine): reject too large pages with ODM partial pagination - #8776

Open
BenMacha wants to merge 1 commit into
api-platform:5.0from
BenMacha:fix-odm-partial-pagination-overflow-5-0
Open

BenMacha wants to merge 1 commit into
api-platform:5.0from
BenMacha:fix-odm-partial-pagination-overflow-5-0

Conversation

@BenMacha

@BenMacha BenMacha commented Nov 1, 2026

Copy link
Copy Markdown
Q A
Branch? 5.0
Tickets
License MIT
Doc PR

With partial pagination, the ODM PaginationExtension calls limit($offset + $limit). ?page=307445734561825861 with 30 items per page gives an offset that still fits in an int, but the sum does not: it becomes a float and Builder::limit(int) throws a TypeError (500). It now throws the InvalidArgumentException "Page parameter is too large." already used by Pagination::getOffset(), so a 400.

Test: PaginationExtensionTest::testApplyToCollectionWithPartialPaginationAndPageTooLarge.

With partial pagination, a request such as `?page=307445734561825861` with 30
items per page gives an offset that still fits in an integer, but the
`$offset + $limit` passed to the aggregation `$limit` stage overflows to a
float and triggers a TypeError (500). It now throws the same "Page parameter
is too large." InvalidArgumentException as Pagination::getOffset() (400).
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-11-01T08:05:54.093097Z
We couldn’t complete this review. Comment @codex review to try again.
a6ebc75 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant