Skip to content

Commit 1f8ce0a

Browse files
committed
feature #46183 Hide sensitive information with SensitiveParameter attribute (GromNaN)
This PR was squashed before being merged into the 6.2 branch. Discussion ---------- Hide sensitive information with `SensitiveParameter` attribute | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | n/a | License | MIT | Doc PR | n/a New feature for PHP 8.2: [Redact parameters in back traces](https://stitcher.io/blog/new-in-php-82#redact-parameters-in-back-traces-rfc) This could be a "minor" change, but I think it should be highlighted to be fully functional. The annotation is required in all calling functions otherwise the argument value is displayed. Commits ------- 7dcc4ac2b8 Hide sensitive information with `SensitiveParameter` attribute
2 parents e73d973 + f4a7283 commit 1f8ce0a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Controller/AbstractController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ protected function getUser(): ?UserInterface
374374
* @param string $id The id used when generating the token
375375
* @param string|null $token The actual token sent with the request that should be validated
376376
*/
377-
protected function isCsrfTokenValid(string $id, ?string $token): bool
377+
protected function isCsrfTokenValid(string $id, #[\SensitiveParameter] ?string $token): bool
378378
{
379379
if (!$this->container->has('security.csrf.token_manager')) {
380380
throw new \LogicException('CSRF protection is not enabled in your application. Enable it with the "csrf_protection" key in "config/packages/framework.yaml".');

0 commit comments

Comments
 (0)