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

[12.x] Ignore querystring parameters using closure when validating signed url #54104

Conversation

gdebrauwer
Copy link
Contributor

If you want to ignore all utm querystring parameters when validating a signed url, you currently have to provide all those utm parameters in an array:

$request->hasValidSignatureWhileIgnoring(['utm_source', 'utm_medium', 'utm_campaign', 'utm_content', 'utm_term'])

This PR makes that easier by allowing you to provide a closure to determine which querystring parameters should be ignored:

$request->hasValidSignatureWhileIgnoring(fn ($parameter) => Str::startsWith($parameter, 'utm_'));

@gdebrauwer gdebrauwer changed the title [12.x] Ignore querystring parameters using closure when validating url signature [12.x] Ignore querystring parameters using closure when validating signed url Jan 7, 2025
@taylorotwell taylorotwell merged commit 7691c66 into laravel:master Jan 7, 2025
29 checks passed
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.

2 participants