Skip to content

[6.x] Prevent recache tokens from leaking into pagination URLs - #15314

Merged
jasonvarga merged 1 commit into
6.xfrom
fix/recache-token-pagination
Aug 31, 2026
Merged

[6.x] Prevent recache tokens from leaking into pagination URLs#15314
jasonvarga merged 1 commit into
6.xfrom
fix/recache-token-pagination

Conversation

@jackmcdade

Copy link
Copy Markdown
Member

Fixes #15294.

Background recache requests include Statamic's reserved recache token in the query string. The custom paginator was appending the raw request query, causing that token to appear in generated pagination links and become part of the static cache.

This delegates query-string handling to Laravel's resolver, then removes Statamic's configured recache token while preserving legitimate query parameters. It also restores support for custom query-string resolvers.

Testing

  • ./vendor/bin/phpunit tests/Extensions/Pagination/LengthAwarePaginatorTest.php tests/StaticCaching/RecacheTokenTest.php
  • ./vendor/bin/phpunit tests/StaticCaching/HalfMeasureStaticCachingTest.php
  • ./vendor/bin/phpunit tests/StaticCaching/FullMeasureStaticCachingTest.php
  • ./vendor/bin/pint --test src/Extensions/Pagination/LengthAwarePaginator.php tests/Extensions/Pagination/LengthAwarePaginatorTest.php
  • ./vendor/bin/phpstan analyse --memory-limit=2G src/Extensions/Pagination/LengthAwarePaginator.php

@jackmcdade jackmcdade changed the title Prevent recache tokens from leaking into pagination URLs [6.x] Prevent recache tokens from leaking into pagination URLs Aug 31, 2026
@jasonvarga
jasonvarga merged commit 0bf1672 into 6.x Aug 31, 2026
65 of 66 checks passed
@jasonvarga
jasonvarga deleted the fix/recache-token-pagination branch August 31, 2026 14:26
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.

Background recache token (__recache) leaks into pagination links and is baked into the static cache

2 participants