Skip to content

[6.x] Fix page: 0 corrupting the collection tree in ReorderEntriesController - #15429

Merged
jasonvarga merged 1 commit into
6.xfrom
fix/reorder-entries-page-zero
Sep 8, 2026
Merged

[6.x] Fix page: 0 corrupting the collection tree in ReorderEntriesController#15429
jasonvarga merged 1 commit into
6.xfrom
fix/reorder-entries-page-zero

Conversation

@jasonvarga

Copy link
Copy Markdown
Member

page: 0 (or perPage: 0) produces a negative array offset, which slices from the end of the tree, passes the out-of-date guard (the submitted ids genuinely match that slice), and then writes negative keys back onto the tree — appending duplicates instead of overwriting. The corrupt tree reaches disk before a 500 is thrown, permanently breaking the collection's entries listing until someone hand-edits the tree YAML.

Not reachable by clicking — the CP always posts the page it fetched — but a forged/malformed request can hit it via devtools, curl, or a buggy addon, so it's worth hardening.

Adds min:1 to the page/perPage validation rules, matching what already ships for taxonomy reordering.

page: 0 (or perPage: 0) produces a negative array offset, slicing from the
end of the tree, passing the out-of-date guard, and writing negative keys
back onto it — corrupting the collection's tree permanently on disk.
@jasonvarga
jasonvarga merged commit 2db29d6 into 6.x Sep 8, 2026
65 checks passed
@jasonvarga
jasonvarga deleted the fix/reorder-entries-page-zero branch September 8, 2026 19:29
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