Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added new Release Version #3

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Added new Release Version #3

wants to merge 7 commits into from

Conversation

holmey
Copy link
Member

@holmey holmey commented Nov 25, 2020

No description provided.

rocknrolaf and others added 7 commits May 17, 2022 13:55
Craft CMS automatically appends the preview ?token= query param to
all element URLs. This could result in the cache being poisoned by
preview URLs.

Steps to reproduce:
- Have a transformer that provides getCacheKey and retrieves an
  element URL
- Ensure that the cache is empty, e.g. run ./craft clear-caches/all
- Open a preview in the CMS that triggers the transformer
- Open the page without preview token in an incognito tab
- The URL retrieved by the transformer now has an unexpected preview
  token

Preview tokens should NOT be cached as they disable page caching and
may expose content to public visitors that they should not have seen.

This commit adapts the behavior of the {% cache %} twig tag:

https://github.com/craftcms/cms/blob/c21a32ea8f9f3ded626e07c36c85ab0da2379b22/src/web/twig/nodes/CacheNode.php#L48
fix: Ignore cache when in CMS preview
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.

None yet

3 participants