Skip to content
Discussion options

You must be logged in to vote

but considering that it's just a random string that isn't validated in any way, maybe it would be safer to just generate a new random string for each request, instead of using whatever is passed in?

A new random value is generated each time there is a content edit, to ensure that the browser doesn’t load the page from cache when we know something has changed. I don’t think there would be any benefit to changing it more frequently than that.

Or, add some kind of validation like the tokenParam has.

I like that idea. Just made that change for Craft 4.12 and 5.4 (f82baa7). So going forward, craft\web\Request::getIsPreview() will only return true if the x-craft-preview/x-craft-live-preview

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@mmikkel
Comment options

@aelvan
Comment options

@mmikkel
Comment options

@brandonkelly
Comment options

@brandonkelly
Comment options

Answer selected by brandonkelly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
3 participants